<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE GADTs #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE BangPatterns #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}</span><span>
</span><span id="line-5"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Cmm.ContFlowOpt</span><span>
</span><span id="line-6"></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Cmm.ContFlowOpt.html#cmmCfgOpts"><span class="hs-identifier">cmmCfgOpts</span></a></span><span>
</span><span id="line-7"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.ContFlowOpt.html#cmmCfgOptsProc"><span class="hs-identifier">cmmCfgOptsProc</span></a></span><span>
</span><span id="line-8"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.ContFlowOpt.html#removeUnreachableBlocksProc"><span class="hs-identifier">removeUnreachableBlocksProc</span></a></span><span>
</span><span id="line-9"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.ContFlowOpt.html#replaceLabels"><span class="hs-identifier">replaceLabels</span></a></span><span>
</span><span id="line-10"></span><span>    </span><span class="hs-special">)</span><span>
</span><span id="line-11"></span><span class="hs-keyword">where</span><span>
</span><span id="line-12"></span><span>
</span><span id="line-13"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Enum.html#succ"><span class="hs-identifier">succ</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier">unzip</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.List.html#zip"><span class="hs-identifier">zip</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Block</span></a></span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Collections.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Collections</span></a></span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Graph.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Graph</span></a></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html"><span class="hs-identifier">GHC.Cmm.Dataflow.Label</span></a></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html"><span class="hs-identifier">GHC.Cmm.BlockId</span></a></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.html"><span class="hs-identifier">GHC.Cmm</span></a></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html"><span class="hs-identifier">GHC.Cmm.Utils</span></a></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Switch.html"><span class="hs-identifier">GHC.Cmm.Switch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Switch.html#mapSwitchTargets"><span class="hs-identifier">mapSwitchTargets</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Switch.html#switchTargetsToList"><span class="hs-identifier">switchTargetsToList</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html"><span class="hs-identifier">GHC.Data.Maybe</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Panic.html"><span class="hs-identifier">GHC.Utils.Panic</span></a></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-26"></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-28"></span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span class="hs-comment">-- Note [What is shortcutting]</span><span>
</span><span id="line-31"></span><span class="hs-comment">-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~</span><span>
</span><span id="line-32"></span><span class="hs-comment">--</span><span>
</span><span id="line-33"></span><span class="hs-comment">-- Consider this Cmm code:</span><span>
</span><span id="line-34"></span><span class="hs-comment">--</span><span>
</span><span id="line-35"></span><span class="hs-comment">-- L1: ...</span><span>
</span><span id="line-36"></span><span class="hs-comment">--     goto L2;</span><span>
</span><span id="line-37"></span><span class="hs-comment">-- L2: goto L3;</span><span>
</span><span id="line-38"></span><span class="hs-comment">-- L3: ...</span><span>
</span><span id="line-39"></span><span class="hs-comment">--</span><span>
</span><span id="line-40"></span><span class="hs-comment">-- Here L2 is an empty block and contains only an unconditional branch</span><span>
</span><span id="line-41"></span><span class="hs-comment">-- to L3. In this situation any block that jumps to L2 can jump</span><span>
</span><span id="line-42"></span><span class="hs-comment">-- directly to L3:</span><span>
</span><span id="line-43"></span><span class="hs-comment">--</span><span>
</span><span id="line-44"></span><span class="hs-comment">-- L1: ...</span><span>
</span><span id="line-45"></span><span class="hs-comment">--     goto L3;</span><span>
</span><span id="line-46"></span><span class="hs-comment">-- L2: goto L3;</span><span>
</span><span id="line-47"></span><span class="hs-comment">-- L3: ...</span><span>
</span><span id="line-48"></span><span class="hs-comment">--</span><span>
</span><span id="line-49"></span><span class="hs-comment">-- In this situation we say that we shortcut L2 to L3. One of</span><span>
</span><span id="line-50"></span><span class="hs-comment">-- consequences of shortcutting is that some blocks of code may become</span><span>
</span><span id="line-51"></span><span class="hs-comment">-- unreachable (in the example above this is true for L2).</span><span>
</span><span id="line-52"></span><span>
</span><span id="line-53"></span><span>
</span><span id="line-54"></span><span class="hs-comment">-- Note [Control-flow optimisations]</span><span>
</span><span id="line-55"></span><span class="hs-comment">-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span><span>
</span><span id="line-56"></span><span class="hs-comment">--</span><span>
</span><span id="line-57"></span><span class="hs-comment">-- This optimisation does three things:</span><span>
</span><span id="line-58"></span><span class="hs-comment">--</span><span>
</span><span id="line-59"></span><span class="hs-comment">--   - If a block finishes in an unconditional branch to another block</span><span>
</span><span id="line-60"></span><span class="hs-comment">--     and that is the only jump to that block we concatenate the</span><span>
</span><span id="line-61"></span><span class="hs-comment">--     destination block at the end of the current one.</span><span>
</span><span id="line-62"></span><span class="hs-comment">--</span><span>
</span><span id="line-63"></span><span class="hs-comment">--   - If a block finishes in a call whose continuation block is a</span><span>
</span><span id="line-64"></span><span class="hs-comment">--     goto, then we can shortcut the destination, making the</span><span>
</span><span id="line-65"></span><span class="hs-comment">--     continuation block the destination of the goto - but see Note</span><span>
</span><span id="line-66"></span><span class="hs-comment">--     [Shortcut call returns].</span><span>
</span><span id="line-67"></span><span class="hs-comment">--</span><span>
</span><span id="line-68"></span><span class="hs-comment">--   - For any block that is not a call we try to shortcut the</span><span>
</span><span id="line-69"></span><span class="hs-comment">--     destination(s). Additionally, if a block ends with a</span><span>
</span><span id="line-70"></span><span class="hs-comment">--     conditional branch we try to invert the condition.</span><span>
</span><span id="line-71"></span><span class="hs-comment">--</span><span>
</span><span id="line-72"></span><span class="hs-comment">-- Blocks are processed using postorder DFS traversal. A side effect</span><span>
</span><span id="line-73"></span><span class="hs-comment">-- of determining traversal order with a graph search is elimination</span><span>
</span><span id="line-74"></span><span class="hs-comment">-- of any blocks that are unreachable.</span><span>
</span><span id="line-75"></span><span class="hs-comment">--</span><span>
</span><span id="line-76"></span><span class="hs-comment">-- Transformations are improved by working from the end of the graph</span><span>
</span><span id="line-77"></span><span class="hs-comment">-- towards the beginning, because we may be able to perform many</span><span>
</span><span id="line-78"></span><span class="hs-comment">-- shortcuts in one go.</span><span>
</span><span id="line-79"></span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span class="hs-comment">-- Note [Shortcut call returns]</span><span>
</span><span id="line-82"></span><span class="hs-comment">-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span><span>
</span><span id="line-83"></span><span class="hs-comment">--</span><span>
</span><span id="line-84"></span><span class="hs-comment">-- We are going to maintain the &quot;current&quot; graph (LabelMap CmmBlock) as</span><span>
</span><span id="line-85"></span><span class="hs-comment">-- we go, and also a mapping from BlockId to BlockId, representing</span><span>
</span><span id="line-86"></span><span class="hs-comment">-- continuation labels that we have renamed.  This latter mapping is</span><span>
</span><span id="line-87"></span><span class="hs-comment">-- important because we might shortcut a CmmCall continuation.  For</span><span>
</span><span id="line-88"></span><span class="hs-comment">-- example:</span><span>
</span><span id="line-89"></span><span class="hs-comment">--</span><span>
</span><span id="line-90"></span><span class="hs-comment">--    Sp[0] = L</span><span>
</span><span id="line-91"></span><span class="hs-comment">--    call g returns to L</span><span>
</span><span id="line-92"></span><span class="hs-comment">--    L: goto M</span><span>
</span><span id="line-93"></span><span class="hs-comment">--    M: ...</span><span>
</span><span id="line-94"></span><span class="hs-comment">--</span><span>
</span><span id="line-95"></span><span class="hs-comment">-- So when we shortcut the L block, we need to replace not only</span><span>
</span><span id="line-96"></span><span class="hs-comment">-- the continuation of the call, but also references to L in the</span><span>
</span><span id="line-97"></span><span class="hs-comment">-- code (e.g. the assignment Sp[0] = L):</span><span>
</span><span id="line-98"></span><span class="hs-comment">--</span><span>
</span><span id="line-99"></span><span class="hs-comment">--    Sp[0] = M</span><span>
</span><span id="line-100"></span><span class="hs-comment">--    call g returns to M</span><span>
</span><span id="line-101"></span><span class="hs-comment">--    M: ...</span><span>
</span><span id="line-102"></span><span class="hs-comment">--</span><span>
</span><span id="line-103"></span><span class="hs-comment">-- So we keep track of which labels we have renamed and apply the mapping</span><span>
</span><span id="line-104"></span><span class="hs-comment">-- at the end with replaceLabels.</span><span>
</span><span id="line-105"></span><span>
</span><span id="line-106"></span><span>
</span><span id="line-107"></span><span class="hs-comment">-- Note [Shortcut call returns and proc-points]</span><span>
</span><span id="line-108"></span><span class="hs-comment">-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span><span>
</span><span id="line-109"></span><span class="hs-comment">--</span><span>
</span><span id="line-110"></span><span class="hs-comment">-- Consider this code that you might get from a recursive</span><span>
</span><span id="line-111"></span><span class="hs-comment">-- let-no-escape:</span><span>
</span><span id="line-112"></span><span class="hs-comment">--</span><span>
</span><span id="line-113"></span><span class="hs-comment">--       goto L1</span><span>
</span><span id="line-114"></span><span class="hs-comment">--      L1:</span><span>
</span><span id="line-115"></span><span class="hs-comment">--       if (Hp &gt; HpLim) then L2 else L3</span><span>
</span><span id="line-116"></span><span class="hs-comment">--      L2:</span><span>
</span><span id="line-117"></span><span class="hs-comment">--       call stg_gc_noregs returns to L4</span><span>
</span><span id="line-118"></span><span class="hs-comment">--      L4:</span><span>
</span><span id="line-119"></span><span class="hs-comment">--       goto L1</span><span>
</span><span id="line-120"></span><span class="hs-comment">--      L3:</span><span>
</span><span id="line-121"></span><span class="hs-comment">--       ...</span><span>
</span><span id="line-122"></span><span class="hs-comment">--       goto L1</span><span>
</span><span id="line-123"></span><span class="hs-comment">--</span><span>
</span><span id="line-124"></span><span class="hs-comment">-- Then the control-flow optimiser shortcuts L4.  But that turns L1</span><span>
</span><span id="line-125"></span><span class="hs-comment">-- into the call-return proc point, and every iteration of the loop</span><span>
</span><span id="line-126"></span><span class="hs-comment">-- has to shuffle variables to and from the stack.  So we must *not*</span><span>
</span><span id="line-127"></span><span class="hs-comment">-- shortcut L4.</span><span>
</span><span id="line-128"></span><span class="hs-comment">--</span><span>
</span><span id="line-129"></span><span class="hs-comment">-- Moreover not shortcutting call returns is probably fine.  If L4 can</span><span>
</span><span id="line-130"></span><span class="hs-comment">-- concat with its branch target then it will still do so.  And we</span><span>
</span><span id="line-131"></span><span class="hs-comment">-- save some compile time because we don't have to traverse all the</span><span>
</span><span id="line-132"></span><span class="hs-comment">-- code in replaceLabels.</span><span>
</span><span id="line-133"></span><span class="hs-comment">--</span><span>
</span><span id="line-134"></span><span class="hs-comment">-- However, we probably do want to do this if we are splitting proc</span><span>
</span><span id="line-135"></span><span class="hs-comment">-- points, because L1 will be a proc-point anyway, so merging it with</span><span>
</span><span id="line-136"></span><span class="hs-comment">-- L4 reduces the number of proc points.  Unfortunately recursive</span><span>
</span><span id="line-137"></span><span class="hs-comment">-- let-no-escapes won't generate very good code with proc-point</span><span>
</span><span id="line-138"></span><span class="hs-comment">-- splitting on - we should probably compile them to explicitly use</span><span>
</span><span id="line-139"></span><span class="hs-comment">-- the native calling convention instead.</span><span>
</span><span id="line-140"></span><span>
</span><span id="line-141"></span><span class="annot"><a href="GHC.Cmm.ContFlowOpt.html#cmmCfgOpts"><span class="hs-identifier hs-type">cmmCfgOpts</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span>
</span><span id="line-142"></span><span id="cmmCfgOpts"><span class="annot"><span class="annottext">cmmCfgOpts :: Bool -&gt; CmmGraph -&gt; CmmGraph
</span><a href="GHC.Cmm.ContFlowOpt.html#cmmCfgOpts"><span class="hs-identifier hs-var hs-var">cmmCfgOpts</span></a></span></span><span> </span><span id="local-6989586621681048321"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681048321"><span class="hs-identifier hs-var">split</span></a></span></span><span> </span><span id="local-6989586621681048320"><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681048320"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CmmGraph, LabelMap Label) -&gt; CmmGraph
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; CmmGraph -&gt; (CmmGraph, LabelMap Label)
</span><a href="GHC.Cmm.ContFlowOpt.html#blockConcat"><span class="hs-identifier hs-var">blockConcat</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681048321"><span class="hs-identifier hs-var">split</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681048320"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-143"></span><span>
</span><span id="line-144"></span><span class="annot"><a href="GHC.Cmm.ContFlowOpt.html#cmmCfgOptsProc"><span class="hs-identifier hs-type">cmmCfgOptsProc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmDecl"><span class="hs-identifier hs-type">CmmDecl</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmDecl"><span class="hs-identifier hs-type">CmmDecl</span></a></span><span>
</span><span id="line-145"></span><span id="cmmCfgOptsProc"><span class="annot"><span class="annottext">cmmCfgOptsProc :: Bool -&gt; CmmDecl -&gt; CmmDecl
</span><a href="GHC.Cmm.ContFlowOpt.html#cmmCfgOptsProc"><span class="hs-identifier hs-var hs-var">cmmCfgOptsProc</span></a></span></span><span> </span><span id="local-6989586621681048318"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681048318"><span class="hs-identifier hs-var">split</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-type">CmmProc</span></a></span><span> </span><span id="local-6989586621681048316"><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681048316"><span class="hs-identifier hs-var">info</span></a></span></span><span> </span><span id="local-6989586621681048315"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681048315"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621681048314"><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681048314"><span class="hs-identifier hs-var">live</span></a></span></span><span> </span><span id="local-6989586621681048313"><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681048313"><span class="hs-identifier hs-var">g</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmTopInfo -&gt; CLabel -&gt; [GlobalReg] -&gt; CmmGraph -&gt; CmmDecl
forall d h g. h -&gt; CLabel -&gt; [GlobalReg] -&gt; g -&gt; GenCmmDecl d h g
</span><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-var">CmmProc</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681048312"><span class="hs-identifier hs-var">info'</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681048315"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681048314"><span class="hs-identifier hs-var">live</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681048311"><span class="hs-identifier hs-var">g'</span></a></span><span>
</span><span id="line-146"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681048311"><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681048311"><span class="hs-identifier hs-var">g'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681048310"><span class="annot"><span class="annottext">LabelMap Label
</span><a href="#local-6989586621681048310"><span class="hs-identifier hs-var">env</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; CmmGraph -&gt; (CmmGraph, LabelMap Label)
</span><a href="GHC.Cmm.ContFlowOpt.html#blockConcat"><span class="hs-identifier hs-var">blockConcat</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681048318"><span class="hs-identifier hs-var">split</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681048313"><span class="hs-identifier hs-var">g</span></a></span><span>
</span><span id="line-147"></span><span>          </span><span id="local-6989586621681048312"><span class="annot"><span class="annottext">info' :: CmmTopInfo
</span><a href="#local-6989586621681048312"><span class="hs-identifier hs-var hs-var">info'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681048316"><span class="hs-identifier hs-var">info</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">info_tbls :: LabelMap CmmInfoTable
</span><a href="GHC.Cmm.html#info_tbls"><span class="hs-identifier hs-var">info_tbls</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LabelMap CmmInfoTable
</span><a href="#local-6989586621681048308"><span class="hs-identifier hs-var">new_info_tbls</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-148"></span><span>          </span><span id="local-6989586621681048308"><span class="annot"><span class="annottext">new_info_tbls :: LabelMap CmmInfoTable
</span><a href="#local-6989586621681048308"><span class="hs-identifier hs-var hs-var">new_info_tbls</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(KeyOf LabelMap, CmmInfoTable)] -&gt; LabelMap CmmInfoTable
forall (map :: * -&gt; *) a. IsMap map =&gt; [(KeyOf map, a)] -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapFromList"><span class="hs-identifier hs-var">mapFromList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((Label, CmmInfoTable) -&gt; (Label, CmmInfoTable))
-&gt; [(Label, CmmInfoTable)] -&gt; [(Label, CmmInfoTable)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(Label, CmmInfoTable) -&gt; (Label, CmmInfoTable)
</span><a href="#local-6989586621681048306"><span class="hs-identifier hs-var">upd_info</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LabelMap CmmInfoTable -&gt; [(KeyOf LabelMap, CmmInfoTable)]
forall (map :: * -&gt; *) a. IsMap map =&gt; map a -&gt; [(KeyOf map, a)]
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapToList"><span class="hs-identifier hs-var">mapToList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmTopInfo -&gt; LabelMap CmmInfoTable
</span><a href="GHC.Cmm.html#info_tbls"><span class="hs-identifier hs-var hs-var">info_tbls</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681048316"><span class="hs-identifier hs-var">info</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-149"></span><span>
</span><span id="line-150"></span><span>          </span><span class="hs-comment">-- If we changed any labels, then we have to update the info tables</span><span>
</span><span id="line-151"></span><span>          </span><span class="hs-comment">-- too, except for the top-level info table because that might be</span><span>
</span><span id="line-152"></span><span>          </span><span class="hs-comment">-- referred to by other procs.</span><span>
</span><span id="line-153"></span><span>          </span><span id="local-6989586621681048306"><span class="annot"><span class="annottext">upd_info :: (Label, CmmInfoTable) -&gt; (Label, CmmInfoTable)
</span><a href="#local-6989586621681048306"><span class="hs-identifier hs-var hs-var">upd_info</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681048304"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048304"><span class="hs-identifier hs-var">k</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681048303"><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681048303"><span class="hs-identifier hs-var">info</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-154"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681048302"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048302"><span class="hs-identifier hs-var">k'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap Label -&gt; Maybe Label
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681048304"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap Label
</span><a href="#local-6989586621681048310"><span class="hs-identifier hs-var">env</span></a></span><span>
</span><span id="line-155"></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048302"><span class="hs-identifier hs-var">k'</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048302"><span class="hs-identifier hs-var">k'</span></a></span><span> </span><span class="annot"><span class="annottext">Label -&gt; Label -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">CmmGraph -&gt; Label
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; Label
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681048311"><span class="hs-identifier hs-var">g'</span></a></span><span>
</span><span id="line-156"></span><span>                       </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681048303"><span class="hs-identifier hs-var">info</span></a></span><span>
</span><span id="line-157"></span><span>                       </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681048303"><span class="hs-identifier hs-var">info</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cit_lbl :: CLabel
</span><a href="GHC.Cmm.html#cit_lbl"><span class="hs-identifier hs-var">cit_lbl</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Label -&gt; CLabel
</span><a href="GHC.Cmm.BlockId.html#infoTblLbl"><span class="hs-identifier hs-var">infoTblLbl</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048302"><span class="hs-identifier hs-var">k'</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-158"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-159"></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048304"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681048303"><span class="hs-identifier hs-var">info</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-160"></span><span class="annot"><a href="GHC.Cmm.ContFlowOpt.html#cmmCfgOptsProc"><span class="hs-identifier hs-var">cmmCfgOptsProc</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681048297"><span class="annot"><span class="annottext">CmmDecl
</span><a href="#local-6989586621681048297"><span class="hs-identifier hs-var">top</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmDecl
</span><a href="#local-6989586621681048297"><span class="hs-identifier hs-var">top</span></a></span><span>
</span><span id="line-161"></span><span>
</span><span id="line-162"></span><span>
</span><span id="line-163"></span><span class="annot"><a href="GHC.Cmm.ContFlowOpt.html#blockConcat"><span class="hs-identifier hs-type">blockConcat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-164"></span><span id="blockConcat"><span class="annot"><span class="annottext">blockConcat :: Bool -&gt; CmmGraph -&gt; (CmmGraph, LabelMap Label)
</span><a href="GHC.Cmm.ContFlowOpt.html#blockConcat"><span class="hs-identifier hs-var hs-var">blockConcat</span></a></span></span><span> </span><span id="local-6989586621681048295"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681048295"><span class="hs-identifier hs-var">splitting_procs</span></a></span></span><span> </span><span id="local-6989586621681048294"><span class="annot"><span class="annottext">g :: CmmGraph
</span><a href="#local-6989586621681048294"><span class="hs-identifier hs-var">g</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">g_entry :: forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; Label
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var">g_entry</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681048292"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048292"><span class="hs-identifier hs-var">entry_id</span></a></span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-165"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LabelMap Label -&gt; CmmGraph -&gt; CmmGraph
</span><a href="GHC.Cmm.ContFlowOpt.html#replaceLabels"><span class="hs-identifier hs-var">replaceLabels</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap Label
</span><a href="#local-6989586621681048291"><span class="hs-identifier hs-var">shortcut_map</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmGraph -&gt; CmmGraph) -&gt; CmmGraph -&gt; CmmGraph
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Label -&gt; LabelMap CmmBlock -&gt; CmmGraph
</span><a href="GHC.Cmm.Utils.html#ofBlockMap"><span class="hs-identifier hs-var">ofBlockMap</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048289"><span class="hs-identifier hs-var">new_entry</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681048288"><span class="hs-identifier hs-var">new_blocks</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LabelMap Label
</span><a href="#local-6989586621681048287"><span class="hs-identifier hs-var">shortcut_map'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-166"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-167"></span><span>     </span><span class="hs-comment">-- We might be able to shortcut the entry BlockId itself.</span><span>
</span><span id="line-168"></span><span>     </span><span class="hs-comment">-- Remember to update the shortcut_map, since we also have to</span><span>
</span><span id="line-169"></span><span>     </span><span class="hs-comment">-- update the info_tbls mapping now.</span><span>
</span><span id="line-170"></span><span>     </span><span class="hs-special">(</span><span id="local-6989586621681048289"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048289"><span class="hs-identifier hs-var">new_entry</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681048287"><span class="annot"><span class="annottext">LabelMap Label
</span><a href="#local-6989586621681048287"><span class="hs-identifier hs-var">shortcut_map'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-171"></span><span>       </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681048286"><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681048286"><span class="hs-identifier hs-var">entry_blk</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap CmmBlock -&gt; Maybe CmmBlock
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681048292"><span class="hs-identifier hs-var">entry_id</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681048288"><span class="hs-identifier hs-var">new_blocks</span></a></span><span>
</span><span id="line-172"></span><span>       </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681048285"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048285"><span class="hs-identifier hs-var">dest</span></a></span></span><span>      </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmBlock -&gt; Maybe Label
</span><a href="GHC.Cmm.ContFlowOpt.html#canShortcut"><span class="hs-identifier hs-var">canShortcut</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681048286"><span class="hs-identifier hs-var">entry_blk</span></a></span><span>
</span><span id="line-173"></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048285"><span class="hs-identifier hs-var">dest</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; Label -&gt; LabelMap Label -&gt; LabelMap Label
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsert"><span class="hs-identifier hs-var">mapInsert</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681048292"><span class="hs-identifier hs-var">entry_id</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048285"><span class="hs-identifier hs-var">dest</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap Label
</span><a href="#local-6989586621681048291"><span class="hs-identifier hs-var">shortcut_map</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-174"></span><span>       </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-175"></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048292"><span class="hs-identifier hs-var">entry_id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LabelMap Label
</span><a href="#local-6989586621681048291"><span class="hs-identifier hs-var">shortcut_map</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-176"></span><span>
</span><span id="line-177"></span><span>     </span><span class="hs-comment">-- blocks are sorted in reverse postorder, but we want to go from the exit</span><span>
</span><span id="line-178"></span><span>     </span><span class="hs-comment">-- towards beginning, so we use foldr below.</span><span>
</span><span id="line-179"></span><span>     </span><span id="local-6989586621681048282"><span class="annot"><span class="annottext">blocks :: [CmmBlock]
</span><a href="#local-6989586621681048282"><span class="hs-identifier hs-var hs-var">blocks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmGraph -&gt; [CmmBlock]
</span><a href="GHC.Cmm.Utils.html#revPostorder"><span class="hs-identifier hs-var">revPostorder</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681048294"><span class="hs-identifier hs-var">g</span></a></span><span>
</span><span id="line-180"></span><span>     </span><span id="local-6989586621681048280"><span class="annot"><span class="annottext">blockmap :: LabelMap CmmBlock
</span><a href="#local-6989586621681048280"><span class="hs-identifier hs-var hs-var">blockmap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LabelMap CmmBlock -&gt; CmmBlock -&gt; LabelMap CmmBlock)
-&gt; LabelMap CmmBlock -&gt; [CmmBlock] -&gt; LabelMap CmmBlock
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(CmmBlock -&gt; LabelMap CmmBlock -&gt; LabelMap CmmBlock)
-&gt; LabelMap CmmBlock -&gt; CmmBlock -&gt; LabelMap CmmBlock
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock -&gt; LabelMap CmmBlock -&gt; LabelMap CmmBlock
forall (block :: Extensibility -&gt; Extensibility -&gt; *).
(NonLocal block, HasDebugCallStack) =&gt;
block C C -&gt; LabelMap (block C C) -&gt; LabelMap (block C C)
</span><a href="GHC.Cmm.Dataflow.Graph.html#addBlock"><span class="hs-identifier hs-var">addBlock</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LabelMap CmmBlock
forall (block :: (Extensibility -&gt; Extensibility -&gt; *)
                 -&gt; Extensibility -&gt; Extensibility -&gt; *)
       (n :: Extensibility -&gt; Extensibility -&gt; *).
Body' block n
</span><a href="GHC.Cmm.Dataflow.Graph.html#emptyBody"><span class="hs-identifier hs-var">emptyBody</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681048282"><span class="hs-identifier hs-var">blocks</span></a></span><span>
</span><span id="line-181"></span><span>
</span><span id="line-182"></span><span>     </span><span class="hs-comment">-- Accumulator contains three components:</span><span>
</span><span id="line-183"></span><span>     </span><span class="hs-comment">--  * map of blocks in a graph</span><span>
</span><span id="line-184"></span><span>     </span><span class="hs-comment">--  * map of shortcut labels. See Note [Shortcut call returns]</span><span>
</span><span id="line-185"></span><span>     </span><span class="hs-comment">--  * map containing number of predecessors for each block. We discard</span><span>
</span><span id="line-186"></span><span>     </span><span class="hs-comment">--    it after we process all blocks.</span><span>
</span><span id="line-187"></span><span>     </span><span class="hs-special">(</span><span id="local-6989586621681048288"><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681048288"><span class="hs-identifier hs-var">new_blocks</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681048291"><span class="annot"><span class="annottext">LabelMap Label
</span><a href="#local-6989586621681048291"><span class="hs-identifier hs-var">shortcut_map</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LabelMap Int
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-188"></span><span>           </span><span class="annot"><span class="annottext">(CmmBlock
 -&gt; (LabelMap CmmBlock, LabelMap Label, LabelMap Int)
 -&gt; (LabelMap CmmBlock, LabelMap Label, LabelMap Int))
-&gt; (LabelMap CmmBlock, LabelMap Label, LabelMap Int)
-&gt; [CmmBlock]
-&gt; (LabelMap CmmBlock, LabelMap Label, LabelMap Int)
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock
-&gt; (LabelMap CmmBlock, LabelMap Label, LabelMap Int)
-&gt; (LabelMap CmmBlock, LabelMap Label, LabelMap Int)
</span><a href="#local-6989586621681048274"><span class="hs-identifier hs-var">maybe_concat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681048280"><span class="hs-identifier hs-var">blockmap</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LabelMap Label
forall (map :: * -&gt; *) a. IsMap map =&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapEmpty"><span class="hs-identifier hs-var">mapEmpty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LabelMap Int
</span><a href="#local-6989586621681048272"><span class="hs-identifier hs-var">initialBackEdges</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681048282"><span class="hs-identifier hs-var">blocks</span></a></span><span>
</span><span id="line-189"></span><span>
</span><span id="line-190"></span><span>     </span><span class="hs-comment">-- Map of predecessors for initial graph. We increase number of</span><span>
</span><span id="line-191"></span><span>     </span><span class="hs-comment">-- predecessors for entry block by one to denote that it is</span><span>
</span><span id="line-192"></span><span>     </span><span class="hs-comment">-- target of a jump, even if no block in the current graph jumps</span><span>
</span><span id="line-193"></span><span>     </span><span class="hs-comment">-- to it.</span><span>
</span><span id="line-194"></span><span>     </span><span id="local-6989586621681048272"><span class="annot"><span class="annottext">initialBackEdges :: LabelMap Int
</span><a href="#local-6989586621681048272"><span class="hs-identifier hs-var hs-var">initialBackEdges</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Label -&gt; LabelMap Int -&gt; LabelMap Int
</span><a href="GHC.Cmm.ContFlowOpt.html#incPreds"><span class="hs-identifier hs-var">incPreds</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048292"><span class="hs-identifier hs-var">entry_id</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CmmBlock] -&gt; LabelMap Int
</span><a href="GHC.Cmm.ContFlowOpt.html#predMap"><span class="hs-identifier hs-var">predMap</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681048282"><span class="hs-identifier hs-var">blocks</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-195"></span><span>
</span><span id="line-196"></span><span>     </span><span class="annot"><a href="#local-6989586621681048274"><span class="hs-identifier hs-type">maybe_concat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span>
</span><span id="line-197"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span>
</span><span id="line-198"></span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">)</span><span>
</span><span id="line-199"></span><span>     </span><span id="local-6989586621681048274"><span class="annot"><span class="annottext">maybe_concat :: CmmBlock
-&gt; (LabelMap CmmBlock, LabelMap Label, LabelMap Int)
-&gt; (LabelMap CmmBlock, LabelMap Label, LabelMap Int)
</span><a href="#local-6989586621681048274"><span class="hs-identifier hs-var hs-var">maybe_concat</span></a></span></span><span> </span><span id="local-6989586621681048269"><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681048269"><span class="hs-identifier hs-var">block</span></a></span></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">!</span><span id="local-6989586621681048268"><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681048268"><span class="hs-identifier hs-var">blocks</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681048267"><span class="annot"><span class="annottext">LabelMap Label
</span><a href="#local-6989586621681048267"><span class="hs-identifier hs-var">shortcut_map</span></a></span></span><span class="hs-special">,</span><span> </span><span class="hs-glyph">!</span><span id="local-6989586621681048266"><span class="annot"><span class="annottext">LabelMap Int
</span><a href="#local-6989586621681048266"><span class="hs-identifier hs-var">backEdges</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-200"></span><span>        </span><span class="hs-comment">-- If:</span><span>
</span><span id="line-201"></span><span>        </span><span class="hs-comment">--   (1) current block ends with unconditional branch to b' and</span><span>
</span><span id="line-202"></span><span>        </span><span class="hs-comment">--   (2) it has exactly one predecessor (namely, current block)</span><span>
</span><span id="line-203"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-204"></span><span>        </span><span class="hs-comment">-- Then:</span><span>
</span><span id="line-205"></span><span>        </span><span class="hs-comment">--   (1) append b' block at the end of current block</span><span>
</span><span id="line-206"></span><span>        </span><span class="hs-comment">--   (2) remove b' from the map of blocks</span><span>
</span><span id="line-207"></span><span>        </span><span class="hs-comment">--   (3) remove information about b' from predecessors map</span><span>
</span><span id="line-208"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-209"></span><span>        </span><span class="hs-comment">-- Since we know that the block has only one predecessor we call</span><span>
</span><span id="line-210"></span><span>        </span><span class="hs-comment">-- mapDelete directly instead of calling decPreds.</span><span>
</span><span id="line-211"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-212"></span><span>        </span><span class="hs-comment">-- Note that we always maintain an up-to-date list of predecessors, so</span><span>
</span><span id="line-213"></span><span>        </span><span class="hs-comment">-- we can ignore the contents of shortcut_map</span><span>
</span><span id="line-214"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmBranch"><span class="hs-identifier hs-type">CmmBranch</span></a></span><span> </span><span id="local-6989586621681048257"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048257"><span class="hs-identifier hs-var">b'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681048256"><span class="hs-identifier hs-var">last</span></a></span><span>
</span><span id="line-215"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Label -&gt; Bool
</span><a href="#local-6989586621681048255"><span class="hs-identifier hs-var">hasOnePredecessor</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048257"><span class="hs-identifier hs-var">b'</span></a></span><span>
</span><span id="line-216"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681048254"><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681048254"><span class="hs-identifier hs-var">blk'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap CmmBlock -&gt; Maybe CmmBlock
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681048257"><span class="hs-identifier hs-var">b'</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681048268"><span class="hs-identifier hs-var">blocks</span></a></span><span>
</span><span id="line-217"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681048253"><span class="annot"><span class="annottext">bid' :: Label
</span><a href="#local-6989586621681048253"><span class="hs-identifier hs-var hs-var">bid'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmBlock -&gt; Label
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
NonLocal thing =&gt;
thing C x -&gt; Label
</span><a href="GHC.Cmm.Dataflow.Graph.html#entryLabel"><span class="hs-identifier hs-var">entryLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681048254"><span class="hs-identifier hs-var">blk'</span></a></span><span>
</span><span id="line-218"></span><span>          </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap CmmBlock -&gt; LabelMap CmmBlock
forall (map :: * -&gt; *) a. IsMap map =&gt; KeyOf map -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapDelete"><span class="hs-identifier hs-var">mapDelete</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681048253"><span class="hs-identifier hs-var">bid'</span></a></span><span> </span><span class="annot"><span class="annottext">(LabelMap CmmBlock -&gt; LabelMap CmmBlock)
-&gt; LabelMap CmmBlock -&gt; LabelMap CmmBlock
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
-&gt; CmmBlock -&gt; LabelMap CmmBlock -&gt; LabelMap CmmBlock
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsert"><span class="hs-identifier hs-var">mapInsert</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681048250"><span class="hs-identifier hs-var">bid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Block CmmNode C O -&gt; CmmBlock -&gt; CmmBlock
</span><a href="GHC.Cmm.ContFlowOpt.html#splice"><span class="hs-identifier hs-var">splice</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C O
</span><a href="#local-6989586621681048248"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681048254"><span class="hs-identifier hs-var">blk'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681048268"><span class="hs-identifier hs-var">blocks</span></a></span><span>
</span><span id="line-219"></span><span>             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LabelMap Label
</span><a href="#local-6989586621681048267"><span class="hs-identifier hs-var">shortcut_map</span></a></span><span>
</span><span id="line-220"></span><span>             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap Int -&gt; LabelMap Int
forall (map :: * -&gt; *) a. IsMap map =&gt; KeyOf map -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapDelete"><span class="hs-identifier hs-var">mapDelete</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681048257"><span class="hs-identifier hs-var">b'</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap Int
</span><a href="#local-6989586621681048266"><span class="hs-identifier hs-var">backEdges</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-221"></span><span>
</span><span id="line-222"></span><span>        </span><span class="hs-comment">-- If:</span><span>
</span><span id="line-223"></span><span>        </span><span class="hs-comment">--   (1) we are splitting proc points (see Note</span><span>
</span><span id="line-224"></span><span>        </span><span class="hs-comment">--       [Shortcut call returns and proc-points]) and</span><span>
</span><span id="line-225"></span><span>        </span><span class="hs-comment">--   (2) current block is a CmmCall or CmmForeignCall with</span><span>
</span><span id="line-226"></span><span>        </span><span class="hs-comment">--       continuation b' and</span><span>
</span><span id="line-227"></span><span>        </span><span class="hs-comment">--   (3) we can shortcut that continuation to dest</span><span>
</span><span id="line-228"></span><span>        </span><span class="hs-comment">-- Then:</span><span>
</span><span id="line-229"></span><span>        </span><span class="hs-comment">--   (1) we change continuation to point to b'</span><span>
</span><span id="line-230"></span><span>        </span><span class="hs-comment">--   (2) create mapping from b' to dest</span><span>
</span><span id="line-231"></span><span>        </span><span class="hs-comment">--   (3) increase number of predecessors of dest by 1</span><span>
</span><span id="line-232"></span><span>        </span><span class="hs-comment">--   (4) decrease number of predecessors of b' by 1</span><span>
</span><span id="line-233"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-234"></span><span>        </span><span class="hs-comment">-- Later we will use replaceLabels to substitute all occurrences of b'</span><span>
</span><span id="line-235"></span><span>        </span><span class="hs-comment">-- with dest.</span><span>
</span><span id="line-236"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681048295"><span class="hs-identifier hs-var">splitting_procs</span></a></span><span>
</span><span id="line-237"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681048247"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048247"><span class="hs-identifier hs-var">b'</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmNode O C -&gt; Maybe Label
</span><a href="GHC.Cmm.ContFlowOpt.html#callContinuation_maybe"><span class="hs-identifier hs-var">callContinuation_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681048256"><span class="hs-identifier hs-var">last</span></a></span><span>
</span><span id="line-238"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681048245"><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681048245"><span class="hs-identifier hs-var">blk'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap CmmBlock -&gt; Maybe CmmBlock
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681048247"><span class="hs-identifier hs-var">b'</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681048268"><span class="hs-identifier hs-var">blocks</span></a></span><span>
</span><span id="line-239"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681048244"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048244"><span class="hs-identifier hs-var">dest</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmBlock -&gt; Maybe Label
</span><a href="GHC.Cmm.ContFlowOpt.html#canShortcut"><span class="hs-identifier hs-var">canShortcut</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681048245"><span class="hs-identifier hs-var">blk'</span></a></span><span>
</span><span id="line-240"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
-&gt; CmmBlock -&gt; LabelMap CmmBlock -&gt; LabelMap CmmBlock
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsert"><span class="hs-identifier hs-var">mapInsert</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681048250"><span class="hs-identifier hs-var">bid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Block CmmNode C O -&gt; CmmNode O C -&gt; CmmBlock
forall (n :: Extensibility -&gt; Extensibility -&gt; *)
       (e :: Extensibility).
Block n e O -&gt; n O C -&gt; Block n e C
</span><a href="GHC.Cmm.Dataflow.Block.html#blockJoinTail"><span class="hs-identifier hs-var">blockJoinTail</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C O
</span><a href="#local-6989586621681048248"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Label -&gt; CmmNode O C
</span><a href="#local-6989586621681048242"><span class="hs-identifier hs-var">update_cont</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048244"><span class="hs-identifier hs-var">dest</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681048268"><span class="hs-identifier hs-var">blocks</span></a></span><span>
</span><span id="line-241"></span><span>          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; Label -&gt; LabelMap Label -&gt; LabelMap Label
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsert"><span class="hs-identifier hs-var">mapInsert</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681048247"><span class="hs-identifier hs-var">b'</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048244"><span class="hs-identifier hs-var">dest</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap Label
</span><a href="#local-6989586621681048267"><span class="hs-identifier hs-var">shortcut_map</span></a></span><span>
</span><span id="line-242"></span><span>          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Label -&gt; LabelMap Int -&gt; LabelMap Int
</span><a href="GHC.Cmm.ContFlowOpt.html#decPreds"><span class="hs-identifier hs-var">decPreds</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048247"><span class="hs-identifier hs-var">b'</span></a></span><span> </span><span class="annot"><span class="annottext">(LabelMap Int -&gt; LabelMap Int) -&gt; LabelMap Int -&gt; LabelMap Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Label -&gt; LabelMap Int -&gt; LabelMap Int
</span><a href="GHC.Cmm.ContFlowOpt.html#incPreds"><span class="hs-identifier hs-var">incPreds</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048244"><span class="hs-identifier hs-var">dest</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap Int
</span><a href="#local-6989586621681048266"><span class="hs-identifier hs-var">backEdges</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-243"></span><span>
</span><span id="line-244"></span><span>        </span><span class="hs-comment">-- If:</span><span>
</span><span id="line-245"></span><span>        </span><span class="hs-comment">--   (1) a block does not end with a call</span><span>
</span><span id="line-246"></span><span>        </span><span class="hs-comment">-- Then:</span><span>
</span><span id="line-247"></span><span>        </span><span class="hs-comment">--   (1) if it ends with a conditional attempt to invert the</span><span>
</span><span id="line-248"></span><span>        </span><span class="hs-comment">--       conditional</span><span>
</span><span id="line-249"></span><span>        </span><span class="hs-comment">--   (2) attempt to shortcut all destination blocks</span><span>
</span><span id="line-250"></span><span>        </span><span class="hs-comment">--   (3) if new successors of a block are different from the old ones</span><span>
</span><span id="line-251"></span><span>        </span><span class="hs-comment">--       update the of predecessors accordingly</span><span>
</span><span id="line-252"></span><span>        </span><span class="hs-comment">--</span><span>
</span><span id="line-253"></span><span>        </span><span class="hs-comment">-- A special case of this is a situation when a block ends with an</span><span>
</span><span id="line-254"></span><span>        </span><span class="hs-comment">-- unconditional jump to a block that can be shortcut.</span><span>
</span><span id="line-255"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Maybe Label
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmNode O C -&gt; Maybe Label
</span><a href="GHC.Cmm.ContFlowOpt.html#callContinuation_maybe"><span class="hs-identifier hs-var">callContinuation_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681048256"><span class="hs-identifier hs-var">last</span></a></span><span>
</span><span id="line-256"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681048240"><span class="annot"><span class="annottext">oldSuccs :: [Label]
</span><a href="#local-6989586621681048240"><span class="hs-identifier hs-var hs-var">oldSuccs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmNode O C -&gt; [Label]
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (e :: Extensibility).
NonLocal thing =&gt;
thing e C -&gt; [Label]
</span><a href="GHC.Cmm.Dataflow.Graph.html#successors"><span class="hs-identifier hs-var">successors</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681048256"><span class="hs-identifier hs-var">last</span></a></span><span>
</span><span id="line-257"></span><span>              </span><span id="local-6989586621681048238"><span class="annot"><span class="annottext">newSuccs :: [Label]
</span><a href="#local-6989586621681048238"><span class="hs-identifier hs-var hs-var">newSuccs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmNode O C -&gt; [Label]
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (e :: Extensibility).
NonLocal thing =&gt;
thing e C -&gt; [Label]
</span><a href="GHC.Cmm.Dataflow.Graph.html#successors"><span class="hs-identifier hs-var">successors</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681048237"><span class="hs-identifier hs-var">rewrite_last</span></a></span><span>
</span><span id="line-258"></span><span>          </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
-&gt; CmmBlock -&gt; LabelMap CmmBlock -&gt; LabelMap CmmBlock
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsert"><span class="hs-identifier hs-var">mapInsert</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681048250"><span class="hs-identifier hs-var">bid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Block CmmNode C O -&gt; CmmNode O C -&gt; CmmBlock
forall (n :: Extensibility -&gt; Extensibility -&gt; *)
       (e :: Extensibility).
Block n e O -&gt; n O C -&gt; Block n e C
</span><a href="GHC.Cmm.Dataflow.Block.html#blockJoinTail"><span class="hs-identifier hs-var">blockJoinTail</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C O
</span><a href="#local-6989586621681048248"><span class="hs-identifier hs-var">head</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681048237"><span class="hs-identifier hs-var">rewrite_last</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681048268"><span class="hs-identifier hs-var">blocks</span></a></span><span>
</span><span id="line-259"></span><span>             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LabelMap Label
</span><a href="#local-6989586621681048267"><span class="hs-identifier hs-var">shortcut_map</span></a></span><span>
</span><span id="line-260"></span><span>             </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">[Label]
</span><a href="#local-6989586621681048240"><span class="hs-identifier hs-var">oldSuccs</span></a></span><span> </span><span class="annot"><span class="annottext">[Label] -&gt; [Label] -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">[Label]
</span><a href="#local-6989586621681048238"><span class="hs-identifier hs-var">newSuccs</span></a></span><span>
</span><span id="line-261"></span><span>               </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">LabelMap Int
</span><a href="#local-6989586621681048266"><span class="hs-identifier hs-var">backEdges</span></a></span><span>
</span><span id="line-262"></span><span>               </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">(Label -&gt; LabelMap Int -&gt; LabelMap Int)
-&gt; LabelMap Int -&gt; [Label] -&gt; LabelMap Int
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">Label -&gt; LabelMap Int -&gt; LabelMap Int
</span><a href="GHC.Cmm.ContFlowOpt.html#incPreds"><span class="hs-identifier hs-var">incPreds</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Label -&gt; LabelMap Int -&gt; LabelMap Int)
-&gt; LabelMap Int -&gt; [Label] -&gt; LabelMap Int
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">Label -&gt; LabelMap Int -&gt; LabelMap Int
</span><a href="GHC.Cmm.ContFlowOpt.html#decPreds"><span class="hs-identifier hs-var">decPreds</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap Int
</span><a href="#local-6989586621681048266"><span class="hs-identifier hs-var">backEdges</span></a></span><span> </span><span class="annot"><span class="annottext">[Label]
</span><a href="#local-6989586621681048240"><span class="hs-identifier hs-var">oldSuccs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Label]
</span><a href="#local-6989586621681048238"><span class="hs-identifier hs-var">newSuccs</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-263"></span><span>
</span><span id="line-264"></span><span>        </span><span class="hs-comment">-- Otherwise don't do anything</span><span>
</span><span id="line-265"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-266"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681048268"><span class="hs-identifier hs-var">blocks</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LabelMap Label
</span><a href="#local-6989586621681048267"><span class="hs-identifier hs-var">shortcut_map</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LabelMap Int
</span><a href="#local-6989586621681048266"><span class="hs-identifier hs-var">backEdges</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-267"></span><span>        </span><span class="hs-keyword">where</span><span>
</span><span id="line-268"></span><span>          </span><span class="hs-special">(</span><span id="local-6989586621681048248"><span class="annot"><span class="annottext">Block CmmNode C O
</span><a href="#local-6989586621681048248"><span class="hs-identifier hs-var">head</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681048256"><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681048256"><span class="hs-identifier hs-var">last</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmBlock -&gt; (Block CmmNode C O, CmmNode O C)
forall (n :: Extensibility -&gt; Extensibility -&gt; *)
       (e :: Extensibility).
Block n e C -&gt; (Block n e O, n O C)
</span><a href="GHC.Cmm.Dataflow.Block.html#blockSplitTail"><span class="hs-identifier hs-var">blockSplitTail</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681048269"><span class="hs-identifier hs-var">block</span></a></span><span>
</span><span id="line-269"></span><span>          </span><span id="local-6989586621681048250"><span class="annot"><span class="annottext">bid :: Label
</span><a href="#local-6989586621681048250"><span class="hs-identifier hs-var hs-var">bid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmBlock -&gt; Label
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
NonLocal thing =&gt;
thing C x -&gt; Label
</span><a href="GHC.Cmm.Dataflow.Graph.html#entryLabel"><span class="hs-identifier hs-var">entryLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681048269"><span class="hs-identifier hs-var">block</span></a></span><span>
</span><span id="line-270"></span><span>
</span><span id="line-271"></span><span>          </span><span class="hs-comment">-- Changes continuation of a call to a specified label</span><span>
</span><span id="line-272"></span><span>          </span><span id="local-6989586621681048242"><span class="annot"><span class="annottext">update_cont :: Label -&gt; CmmNode O C
</span><a href="#local-6989586621681048242"><span class="hs-identifier hs-var hs-var">update_cont</span></a></span></span><span> </span><span id="local-6989586621681048235"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048235"><span class="hs-identifier hs-var">dest</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-273"></span><span>              </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681048256"><span class="hs-identifier hs-var">last</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-274"></span><span>                </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmCall"><span class="hs-identifier hs-type">CmmCall</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681048256"><span class="hs-identifier hs-var">last</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cml_cont :: Maybe Label
</span><a href="GHC.Cmm.Node.html#cml_cont"><span class="hs-identifier hs-var">cml_cont</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Label -&gt; Maybe Label
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048235"><span class="hs-identifier hs-var">dest</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-275"></span><span>                </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmForeignCall"><span class="hs-identifier hs-type">CmmForeignCall</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681048256"><span class="hs-identifier hs-var">last</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">succ :: Label
</span><a href="GHC.Cmm.Node.html#succ"><span class="hs-identifier hs-var">succ</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048235"><span class="hs-identifier hs-var">dest</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-276"></span><span>                </span><span class="annot"><span class="annottext">CmmNode O C
</span><span class="hs-identifier">_</span></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; CmmNode O C
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Can't shortcut continuation.&quot;</span></span><span>
</span><span id="line-277"></span><span>
</span><span id="line-278"></span><span>          </span><span class="hs-comment">-- Attempts to shortcut successors of last node</span><span>
</span><span id="line-279"></span><span>          </span><span id="local-6989586621681048225"><span class="annot"><span class="annottext">shortcut_last :: CmmNode O C
</span><a href="#local-6989586621681048225"><span class="hs-identifier hs-var hs-var">shortcut_last</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Label -&gt; Label) -&gt; CmmNode O C -&gt; CmmNode O C
</span><a href="GHC.Cmm.Node.html#mapSuccessors"><span class="hs-identifier hs-var">mapSuccessors</span></a></span><span> </span><span class="annot"><span class="annottext">Label -&gt; Label
</span><a href="#local-6989586621681048223"><span class="hs-identifier hs-var">shortcut</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681048256"><span class="hs-identifier hs-var">last</span></a></span><span>
</span><span id="line-280"></span><span>            </span><span class="hs-keyword">where</span><span>
</span><span id="line-281"></span><span>              </span><span id="local-6989586621681048223"><span class="annot"><span class="annottext">shortcut :: Label -&gt; Label
</span><a href="#local-6989586621681048223"><span class="hs-identifier hs-var hs-var">shortcut</span></a></span></span><span> </span><span id="local-6989586621681048222"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048222"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-282"></span><span>                 </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap CmmBlock -&gt; Maybe CmmBlock
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681048222"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmBlock
</span><a href="#local-6989586621681048268"><span class="hs-identifier hs-var">blocks</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-283"></span><span>                   </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681048221"><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681048221"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681048220"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048220"><span class="hs-identifier hs-var">dest</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmBlock -&gt; Maybe Label
</span><a href="GHC.Cmm.ContFlowOpt.html#canShortcut"><span class="hs-identifier hs-var">canShortcut</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681048221"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048220"><span class="hs-identifier hs-var">dest</span></a></span><span>
</span><span id="line-284"></span><span>                   </span><span id="local-6989586621681048219"><span class="annot"><span class="annottext">Maybe CmmBlock
</span><a href="#local-6989586621681048219"><span class="hs-identifier hs-var">_otherwise</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048222"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-285"></span><span>
</span><span id="line-286"></span><span>          </span><span id="local-6989586621681048237"><span class="annot"><span class="annottext">rewrite_last :: CmmNode O C
</span><a href="#local-6989586621681048237"><span class="hs-identifier hs-var hs-var">rewrite_last</span></a></span></span><span>
</span><span id="line-287"></span><span>            </span><span class="hs-comment">-- Sometimes we can get rid of the conditional completely.</span><span>
</span><span id="line-288"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmCondBranch"><span class="hs-identifier hs-type">CmmCondBranch</span></a></span><span> </span><span id="local-6989586621681048214"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681048214"><span class="hs-identifier hs-var">_cond</span></a></span></span><span> </span><span id="local-6989586621681048213"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048213"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621681048212"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048212"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621681048211"><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681048211"><span class="hs-identifier hs-var">_l</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681048225"><span class="hs-identifier hs-var">shortcut_last</span></a></span><span>
</span><span id="line-289"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048213"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Label -&gt; Label -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048212"><span class="hs-identifier hs-var">f</span></a></span><span>
</span><span id="line-290"></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Label -&gt; CmmNode O C
</span><a href="GHC.Cmm.Node.html#CmmBranch"><span class="hs-identifier hs-var">CmmBranch</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048213"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-291"></span><span>
</span><span id="line-292"></span><span>            </span><span class="hs-comment">-- See Note [Invert Cmm conditionals]</span><span>
</span><span id="line-293"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmCondBranch"><span class="hs-identifier hs-type">CmmCondBranch</span></a></span><span> </span><span id="local-6989586621681048206"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681048206"><span class="hs-identifier hs-var">cond</span></a></span></span><span> </span><span id="local-6989586621681048205"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048205"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621681048204"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048204"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621681048203"><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681048203"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681048225"><span class="hs-identifier hs-var">shortcut_last</span></a></span><span>
</span><span id="line-294"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Label -&gt; Bool
</span><a href="#local-6989586621681048255"><span class="hs-identifier hs-var">hasOnePredecessor</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048205"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-comment">-- inverting will make t a fallthrough</span><span>
</span><span id="line-295"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Maybe Bool -&gt; Bool
</span><a href="#local-6989586621681048202"><span class="hs-identifier hs-var">likelyTrue</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681048203"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Label -&gt; Int
</span><a href="#local-6989586621681048200"><span class="hs-identifier hs-var">numPreds</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048204"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-296"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681048198"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681048198"><span class="hs-identifier hs-var">cond'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; Maybe CmmExpr
</span><a href="GHC.Cmm.Expr.html#maybeInvertCmmExpr"><span class="hs-identifier hs-var">maybeInvertCmmExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681048206"><span class="hs-identifier hs-var">cond</span></a></span><span>
</span><span id="line-297"></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; Label -&gt; Label -&gt; Maybe Bool -&gt; CmmNode O C
</span><a href="GHC.Cmm.Node.html#CmmCondBranch"><span class="hs-identifier hs-var">CmmCondBranch</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681048198"><span class="hs-identifier hs-var">cond'</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048204"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048205"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe Bool -&gt; Maybe Bool
</span><a href="#local-6989586621681048196"><span class="hs-identifier hs-var">invertLikeliness</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681048203"><span class="hs-identifier hs-var">l</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-298"></span><span>
</span><span id="line-299"></span><span>            </span><span class="hs-comment">-- If all jump destinations of a switch go to the</span><span>
</span><span id="line-300"></span><span>            </span><span class="hs-comment">-- same target eliminate the switch.</span><span>
</span><span id="line-301"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmSwitch"><span class="hs-identifier hs-type">CmmSwitch</span></a></span><span> </span><span id="local-6989586621681048190"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681048190"><span class="hs-identifier hs-var">_expr</span></a></span></span><span> </span><span id="local-6989586621681048189"><span class="annot"><span class="annottext">SwitchTargets
</span><a href="#local-6989586621681048189"><span class="hs-identifier hs-var">targets</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681048225"><span class="hs-identifier hs-var">shortcut_last</span></a></span><span>
</span><span id="line-302"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681048188"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048188"><span class="hs-identifier hs-var">t</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681048187"><span class="annot"><span class="annottext">[Label]
</span><a href="#local-6989586621681048187"><span class="hs-identifier hs-var">ts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">SwitchTargets -&gt; [Label]
</span><a href="GHC.Cmm.Switch.html#switchTargetsToList"><span class="hs-identifier hs-var">switchTargetsToList</span></a></span><span> </span><span class="annot"><span class="annottext">SwitchTargets
</span><a href="#local-6989586621681048189"><span class="hs-identifier hs-var">targets</span></a></span><span>
</span><span id="line-303"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(Label -&gt; Bool) -&gt; [Label] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Label -&gt; Label -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048188"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Label]
</span><a href="#local-6989586621681048187"><span class="hs-identifier hs-var">ts</span></a></span><span>
</span><span id="line-304"></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Label -&gt; CmmNode O C
</span><a href="GHC.Cmm.Node.html#CmmBranch"><span class="hs-identifier hs-var">CmmBranch</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048188"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-305"></span><span>
</span><span id="line-306"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-307"></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><a href="#local-6989586621681048225"><span class="hs-identifier hs-var">shortcut_last</span></a></span><span>
</span><span id="line-308"></span><span>
</span><span id="line-309"></span><span>          </span><span id="local-6989586621681048202"><span class="annot"><span class="annottext">likelyTrue :: Maybe Bool -&gt; Bool
</span><a href="#local-6989586621681048202"><span class="hs-identifier hs-var hs-var">likelyTrue</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-310"></span><span>          </span><span class="annot"><a href="#local-6989586621681048202"><span class="hs-identifier hs-var">likelyTrue</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><span class="hs-identifier">_</span></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-311"></span><span>
</span><span id="line-312"></span><span>          </span><span class="annot"><a href="#local-6989586621681048196"><span class="hs-identifier hs-type">invertLikeliness</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-313"></span><span>          </span><span id="local-6989586621681048196"><span class="annot"><span class="annottext">invertLikeliness :: Maybe Bool -&gt; Maybe Bool
</span><a href="#local-6989586621681048196"><span class="hs-identifier hs-var hs-var">invertLikeliness</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Bool -&gt; Bool) -&gt; Maybe Bool -&gt; Maybe Bool
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span>
</span><span id="line-314"></span><span>
</span><span id="line-315"></span><span>          </span><span class="hs-comment">-- Number of predecessors for a block</span><span>
</span><span id="line-316"></span><span>          </span><span id="local-6989586621681048200"><span class="annot"><span class="annottext">numPreds :: Label -&gt; Int
</span><a href="#local-6989586621681048200"><span class="hs-identifier hs-var hs-var">numPreds</span></a></span></span><span> </span><span id="local-6989586621681048184"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048184"><span class="hs-identifier hs-var">bid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap Int -&gt; Maybe Int
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681048184"><span class="hs-identifier hs-var">bid</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap Int
</span><a href="#local-6989586621681048266"><span class="hs-identifier hs-var">backEdges</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Int -&gt; Int -&gt; Int
forall a. Maybe a -&gt; a -&gt; a
</span><a href="GHC.Data.Maybe.html#orElse"><span class="hs-operator hs-var">`orElse`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-317"></span><span>
</span><span id="line-318"></span><span>          </span><span id="local-6989586621681048255"><span class="annot"><span class="annottext">hasOnePredecessor :: Label -&gt; Bool
</span><a href="#local-6989586621681048255"><span class="hs-identifier hs-var hs-var">hasOnePredecessor</span></a></span></span><span> </span><span id="local-6989586621681048182"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048182"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Label -&gt; Int
</span><a href="#local-6989586621681048200"><span class="hs-identifier hs-var">numPreds</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048182"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-319"></span><span>
</span><span id="line-320"></span><span class="hs-comment">{-
  Note [Invert Cmm conditionals]
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  The native code generator always produces jumps to the true branch.
  Falling through to the false branch is however faster. So we try to
  arrange for that to happen.
  This means we invert the condition if:
  * The likely path will become a fallthrough.
  * We can't guarantee a fallthrough for the false branch but for the
    true branch.

  In some cases it's faster to avoid inverting when the false branch is likely.
  However determining when that is the case is neither easy nor cheap so for
  now we always invert as this produces smaller binaries and code that is
  equally fast on average. (On an i7-6700K)

  TODO:
  There is also the edge case when both branches have multiple predecessors.
  In this case we could assume that we will end up with a jump for BOTH
  branches. In this case it might be best to put the likely path in the true
  branch especially if there are large numbers of predecessors as this saves
  us the jump thats not taken. However I haven't tested this and as of early
  2018 we almost never generate cmm where this would apply.
-}</span><span>
</span><span id="line-344"></span><span>
</span><span id="line-345"></span><span class="hs-comment">-- Functions for incrementing and decrementing number of predecessors. If</span><span>
</span><span id="line-346"></span><span class="hs-comment">-- decrementing would set the predecessor count to 0, we remove entry from the</span><span>
</span><span id="line-347"></span><span class="hs-comment">-- map.</span><span>
</span><span id="line-348"></span><span class="hs-comment">-- Invariant: if a block has no predecessors it should be dropped from the</span><span>
</span><span id="line-349"></span><span class="hs-comment">-- graph because it is unreachable. maybe_concat is constructed to maintain</span><span>
</span><span id="line-350"></span><span class="hs-comment">-- that invariant, but calling replaceLabels may introduce unreachable blocks.</span><span>
</span><span id="line-351"></span><span class="hs-comment">-- We rely on subsequent passes in the Cmm pipeline to remove unreachable</span><span>
</span><span id="line-352"></span><span class="hs-comment">-- blocks.</span><span>
</span><span id="line-353"></span><span class="annot"><a href="GHC.Cmm.ContFlowOpt.html#incPreds"><span class="hs-identifier hs-type">incPreds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.ContFlowOpt.html#decPreds"><span class="hs-identifier hs-type">decPreds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-354"></span><span id="incPreds"><span class="annot"><span class="annottext">incPreds :: Label -&gt; LabelMap Int -&gt; LabelMap Int
</span><a href="GHC.Cmm.ContFlowOpt.html#incPreds"><span class="hs-identifier hs-var hs-var">incPreds</span></a></span></span><span> </span><span id="local-6989586621681048181"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048181"><span class="hs-identifier hs-var">bid</span></a></span></span><span> </span><span id="local-6989586621681048180"><span class="annot"><span class="annottext">LabelMap Int
</span><a href="#local-6989586621681048180"><span class="hs-identifier hs-var">edges</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Int -&gt; Int -&gt; Int)
-&gt; KeyOf LabelMap -&gt; Int -&gt; LabelMap Int -&gt; LabelMap Int
forall (map :: * -&gt; *) a.
IsMap map =&gt;
(a -&gt; a -&gt; a) -&gt; KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsertWith"><span class="hs-identifier hs-var">mapInsertWith</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">(+)</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681048181"><span class="hs-identifier hs-var">bid</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">LabelMap Int
</span><a href="#local-6989586621681048180"><span class="hs-identifier hs-var">edges</span></a></span><span>
</span><span id="line-355"></span><span id="decPreds"><span class="annot"><span class="annottext">decPreds :: Label -&gt; LabelMap Int -&gt; LabelMap Int
</span><a href="GHC.Cmm.ContFlowOpt.html#decPreds"><span class="hs-identifier hs-var hs-var">decPreds</span></a></span></span><span> </span><span id="local-6989586621681048177"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048177"><span class="hs-identifier hs-var">bid</span></a></span></span><span> </span><span id="local-6989586621681048176"><span class="annot"><span class="annottext">LabelMap Int
</span><a href="#local-6989586621681048176"><span class="hs-identifier hs-var">edges</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap Int -&gt; Maybe Int
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681048177"><span class="hs-identifier hs-var">bid</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap Int
</span><a href="#local-6989586621681048176"><span class="hs-identifier hs-var">edges</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-356"></span><span>                       </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681048175"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681048175"><span class="hs-identifier hs-var">preds</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681048175"><span class="hs-identifier hs-var">preds</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; Int -&gt; LabelMap Int -&gt; LabelMap Int
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsert"><span class="hs-identifier hs-var">mapInsert</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681048177"><span class="hs-identifier hs-var">bid</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681048175"><span class="hs-identifier hs-var">preds</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LabelMap Int
</span><a href="#local-6989586621681048176"><span class="hs-identifier hs-var">edges</span></a></span><span>
</span><span id="line-357"></span><span>                       </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap Int -&gt; LabelMap Int
forall (map :: * -&gt; *) a. IsMap map =&gt; KeyOf map -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapDelete"><span class="hs-identifier hs-var">mapDelete</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681048177"><span class="hs-identifier hs-var">bid</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap Int
</span><a href="#local-6989586621681048176"><span class="hs-identifier hs-var">edges</span></a></span><span>
</span><span id="line-358"></span><span>                       </span><span class="annot"><span class="annottext">Maybe Int
</span><span class="hs-identifier">_</span></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LabelMap Int
</span><a href="#local-6989586621681048176"><span class="hs-identifier hs-var">edges</span></a></span><span>
</span><span id="line-359"></span><span>
</span><span id="line-360"></span><span>
</span><span id="line-361"></span><span class="hs-comment">-- Checks if a block consists only of &quot;goto dest&quot;. If it does than we return</span><span>
</span><span id="line-362"></span><span class="hs-comment">-- &quot;Just dest&quot; label. See Note [What is shortcutting]</span><span>
</span><span id="line-363"></span><span class="annot"><a href="GHC.Cmm.ContFlowOpt.html#canShortcut"><span class="hs-identifier hs-type">canShortcut</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span>
</span><span id="line-364"></span><span id="canShortcut"><span class="annot"><span class="annottext">canShortcut :: CmmBlock -&gt; Maybe Label
</span><a href="GHC.Cmm.ContFlowOpt.html#canShortcut"><span class="hs-identifier hs-var hs-var">canShortcut</span></a></span></span><span> </span><span id="local-6989586621681048174"><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681048174"><span class="hs-identifier hs-var">block</span></a></span></span><span>
</span><span id="line-365"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmNode C O
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681048173"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681048173"><span class="hs-identifier hs-var">middle</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmBranch"><span class="hs-identifier hs-type">CmmBranch</span></a></span><span> </span><span id="local-6989586621681048169"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048169"><span class="hs-identifier hs-var">dest</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmBlock -&gt; (CmmNode C O, Block CmmNode O O, CmmNode O C)
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
Block n C C -&gt; (n C O, Block n O O, n O C)
</span><a href="GHC.Cmm.Dataflow.Block.html#blockSplit"><span class="hs-identifier hs-var">blockSplit</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681048174"><span class="hs-identifier hs-var">block</span></a></span><span>
</span><span id="line-366"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(CmmNode O O -&gt; Bool) -&gt; [CmmNode O O] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O O -&gt; Bool
forall {e :: Extensibility} {x :: Extensibility}.
CmmNode e x -&gt; Bool
</span><a href="#local-6989586621681048167"><span class="hs-identifier hs-var">dont_care</span></a></span><span> </span><span class="annot"><span class="annottext">([CmmNode O O] -&gt; Bool) -&gt; [CmmNode O O] -&gt; Bool
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O -&gt; [CmmNode O O]
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
Block n O O -&gt; [n O O]
</span><a href="GHC.Cmm.Dataflow.Block.html#blockToList"><span class="hs-identifier hs-var">blockToList</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681048173"><span class="hs-identifier hs-var">middle</span></a></span><span>
</span><span id="line-367"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Label -&gt; Maybe Label
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048169"><span class="hs-identifier hs-var">dest</span></a></span><span>
</span><span id="line-368"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-369"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Label
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-370"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681048167"><span class="annot"><span class="annottext">dont_care :: CmmNode e x -&gt; Bool
</span><a href="#local-6989586621681048167"><span class="hs-identifier hs-var hs-var">dont_care</span></a></span></span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmComment"><span class="hs-identifier hs-type">CmmComment</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-371"></span><span>          </span><span class="annot"><a href="#local-6989586621681048167"><span class="hs-identifier hs-var">dont_care</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmTick"><span class="hs-identifier hs-type">CmmTick</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-372"></span><span>          </span><span class="annot"><a href="#local-6989586621681048167"><span class="hs-identifier hs-var">dont_care</span></a></span><span> </span><span id="local-6989586621681048159"><span class="annot"><span class="annottext">CmmNode e x
</span><a href="#local-6989586621681048159"><span class="hs-identifier hs-var">_other</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-373"></span><span>
</span><span id="line-374"></span><span class="hs-comment">-- Concatenates two blocks. First one is assumed to be open on exit, the second</span><span>
</span><span id="line-375"></span><span class="hs-comment">-- is assumed to be closed on entry (i.e. it has a label attached to it, which</span><span>
</span><span id="line-376"></span><span class="hs-comment">-- the splice function removes by calling snd on result of blockSplitHead).</span><span>
</span><span id="line-377"></span><span class="annot"><a href="GHC.Cmm.ContFlowOpt.html#splice"><span class="hs-identifier hs-type">splice</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#Block"><span class="hs-identifier hs-type">Block</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier hs-type">C</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span>
</span><span id="line-378"></span><span id="splice"><span class="annot"><span class="annottext">splice :: Block CmmNode C O -&gt; CmmBlock -&gt; CmmBlock
</span><a href="GHC.Cmm.ContFlowOpt.html#splice"><span class="hs-identifier hs-var hs-var">splice</span></a></span></span><span> </span><span id="local-6989586621681048158"><span class="annot"><span class="annottext">Block CmmNode C O
</span><a href="#local-6989586621681048158"><span class="hs-identifier hs-var">head</span></a></span></span><span> </span><span id="local-6989586621681048157"><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681048157"><span class="hs-identifier hs-var">rest</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmNode C O
</span><a href="#local-6989586621681048156"><span class="hs-identifier hs-var">entry</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode C O -&gt; Block CmmNode O O -&gt; Block CmmNode C O
forall (n :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
n C O -&gt; Block n O x -&gt; Block n C x
</span><a href="GHC.Cmm.Dataflow.Block.html#blockJoinHead"><span class="hs-operator hs-var">`blockJoinHead`</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681048154"><span class="hs-identifier hs-var">code0</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C O -&gt; Block CmmNode O C -&gt; CmmBlock
forall (n :: Extensibility -&gt; Extensibility -&gt; *)
       (e :: Extensibility) (x :: Extensibility).
Block n e O -&gt; Block n O x -&gt; Block n e x
</span><a href="GHC.Cmm.Dataflow.Block.html#blockAppend"><span class="hs-operator hs-var">`blockAppend`</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode O C
</span><a href="#local-6989586621681048152"><span class="hs-identifier hs-var">code1</span></a></span><span>
</span><span id="line-379"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmEntry"><span class="hs-identifier hs-type">CmmEntry</span></a></span><span> </span><span id="local-6989586621681048148"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048148"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621681048147"><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681048147"><span class="hs-identifier hs-var">sc0</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681048154"><span class="annot"><span class="annottext">Block CmmNode O O
</span><a href="#local-6989586621681048154"><span class="hs-identifier hs-var">code0</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Block CmmNode C O -&gt; (CmmNode C O, Block CmmNode O O)
forall (n :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
Block n C x -&gt; (n C O, Block n O x)
</span><a href="GHC.Cmm.Dataflow.Block.html#blockSplitHead"><span class="hs-identifier hs-var">blockSplitHead</span></a></span><span> </span><span class="annot"><span class="annottext">Block CmmNode C O
</span><a href="#local-6989586621681048158"><span class="hs-identifier hs-var">head</span></a></span><span>
</span><span id="line-380"></span><span>        </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmEntry"><span class="hs-identifier hs-type">CmmEntry</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><span class="hs-identifier">_</span></span><span>   </span><span id="local-6989586621681048143"><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681048143"><span class="hs-identifier hs-var">sc1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681048152"><span class="annot"><span class="annottext">Block CmmNode O C
</span><a href="#local-6989586621681048152"><span class="hs-identifier hs-var">code1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmBlock -&gt; (CmmNode C O, Block CmmNode O C)
forall (n :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
Block n C x -&gt; (n C O, Block n O x)
</span><a href="GHC.Cmm.Dataflow.Block.html#blockSplitHead"><span class="hs-identifier hs-var">blockSplitHead</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock
</span><a href="#local-6989586621681048157"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-381"></span><span>        </span><span id="local-6989586621681048156"><span class="annot"><span class="annottext">entry :: CmmNode C O
</span><a href="#local-6989586621681048156"><span class="hs-identifier hs-var hs-var">entry</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Label -&gt; CmmTickScope -&gt; CmmNode C O
</span><a href="GHC.Cmm.Node.html#CmmEntry"><span class="hs-identifier hs-var">CmmEntry</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048148"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmTickScope -&gt; CmmTickScope -&gt; CmmTickScope
</span><a href="GHC.Cmm.Node.html#combineTickScopes"><span class="hs-identifier hs-var">combineTickScopes</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681048147"><span class="hs-identifier hs-var">sc0</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTickScope
</span><a href="#local-6989586621681048143"><span class="hs-identifier hs-var">sc1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-382"></span><span>
</span><span id="line-383"></span><span class="hs-comment">-- If node is a call with continuation call return Just label of that</span><span>
</span><span id="line-384"></span><span class="hs-comment">-- continuation. Otherwise return Nothing.</span><span>
</span><span id="line-385"></span><span class="annot"><a href="GHC.Cmm.ContFlowOpt.html#callContinuation_maybe"><span class="hs-identifier hs-type">callContinuation_maybe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier hs-type">C</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span>
</span><span id="line-386"></span><span id="callContinuation_maybe"><span class="annot"><span class="annottext">callContinuation_maybe :: CmmNode O C -&gt; Maybe Label
</span><a href="GHC.Cmm.ContFlowOpt.html#callContinuation_maybe"><span class="hs-identifier hs-var hs-var">callContinuation_maybe</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmCall"><span class="hs-identifier hs-type">CmmCall</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">cml_cont :: CmmNode O C -&gt; Maybe Label
</span><a href="GHC.Cmm.Node.html#cml_cont"><span class="hs-identifier hs-var">cml_cont</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681048139"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048139"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Label -&gt; Maybe Label
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048139"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-387"></span><span class="annot"><a href="GHC.Cmm.ContFlowOpt.html#callContinuation_maybe"><span class="hs-identifier hs-var">callContinuation_maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmForeignCall"><span class="hs-identifier hs-type">CmmForeignCall</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">succ :: CmmNode O C -&gt; Label
</span><a href="GHC.Cmm.Node.html#succ"><span class="hs-identifier hs-var">succ</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681048136"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048136"><span class="hs-identifier hs-var">b</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Label -&gt; Maybe Label
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048136"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-388"></span><span class="annot"><a href="GHC.Cmm.ContFlowOpt.html#callContinuation_maybe"><span class="hs-identifier hs-var">callContinuation_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode O C
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe Label
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-389"></span><span>
</span><span id="line-390"></span><span>
</span><span id="line-391"></span><span class="hs-comment">-- Map over the CmmGraph, replacing each label with its mapping in the</span><span>
</span><span id="line-392"></span><span class="hs-comment">-- supplied LabelMap.</span><span>
</span><span id="line-393"></span><span class="annot"><a href="GHC.Cmm.ContFlowOpt.html#replaceLabels"><span class="hs-identifier hs-type">replaceLabels</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.BlockId.html#BlockId"><span class="hs-identifier hs-type">BlockId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmGraph"><span class="hs-identifier hs-type">CmmGraph</span></a></span><span>
</span><span id="line-394"></span><span id="replaceLabels"><span class="annot"><span class="annottext">replaceLabels :: LabelMap Label -&gt; CmmGraph -&gt; CmmGraph
</span><a href="GHC.Cmm.ContFlowOpt.html#replaceLabels"><span class="hs-identifier hs-var hs-var">replaceLabels</span></a></span></span><span> </span><span id="local-6989586621681048135"><span class="annot"><span class="annottext">LabelMap Label
</span><a href="#local-6989586621681048135"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681048134"><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681048134"><span class="hs-identifier hs-var">g</span></a></span></span><span>
</span><span id="line-395"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">LabelMap Label -&gt; Bool
forall (map :: * -&gt; *) a. IsMap map =&gt; map a -&gt; Bool
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapNull"><span class="hs-identifier hs-var">mapNull</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap Label
</span><a href="#local-6989586621681048135"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681048134"><span class="hs-identifier hs-var">g</span></a></span><span>
</span><span id="line-396"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmGraph -&gt; CmmGraph
</span><a href="#local-6989586621681048132"><span class="hs-identifier hs-var">replace_eid</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmGraph -&gt; CmmGraph) -&gt; CmmGraph -&gt; CmmGraph
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(forall (e :: Extensibility) (x :: Extensibility).
 CmmNode e x -&gt; CmmNode e x)
-&gt; CmmGraph -&gt; CmmGraph
</span><a href="GHC.Cmm.Utils.html#mapGraphNodes1"><span class="hs-identifier hs-var">mapGraphNodes1</span></a></span><span> </span><span class="annot"><span class="annottext">forall (e :: Extensibility) (x :: Extensibility).
CmmNode e x -&gt; CmmNode e x
</span><a href="#local-6989586621681048130"><span class="hs-identifier hs-var">txnode</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681048134"><span class="hs-identifier hs-var">g</span></a></span><span>
</span><span id="line-397"></span><span>   </span><span class="hs-keyword">where</span><span>
</span><span id="line-398"></span><span>     </span><span id="local-6989586621681048132"><span class="annot"><span class="annottext">replace_eid :: CmmGraph -&gt; CmmGraph
</span><a href="#local-6989586621681048132"><span class="hs-identifier hs-var hs-var">replace_eid</span></a></span></span><span> </span><span id="local-6989586621681048129"><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681048129"><span class="hs-identifier hs-var">g</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681048129"><span class="hs-identifier hs-var">g</span></a></span><span> </span><span class="hs-special">{</span><span class="annot"><span class="annottext">g_entry :: Label
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var">g_entry</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Label -&gt; Label
</span><a href="#local-6989586621681048128"><span class="hs-identifier hs-var">lookup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmGraph -&gt; Label
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; Label
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681048129"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span class="hs-special">}</span><span>
</span><span id="line-399"></span><span>     </span><span id="local-6989586621681048128"><span class="annot"><span class="annottext">lookup :: Label -&gt; Label
</span><a href="#local-6989586621681048128"><span class="hs-identifier hs-var hs-var">lookup</span></a></span></span><span> </span><span id="local-6989586621681048127"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048127"><span class="hs-identifier hs-var">id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap -&gt; LabelMap Label -&gt; Maybe Label
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; map a -&gt; Maybe a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapLookup"><span class="hs-identifier hs-var">mapLookup</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681048127"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap Label
</span><a href="#local-6989586621681048135"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Label -&gt; Label -&gt; Label
forall a. Maybe a -&gt; a -&gt; a
</span><a href="GHC.Data.Maybe.html#orElse"><span class="hs-operator hs-var">`orElse`</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048127"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-400"></span><span>
</span><span id="line-401"></span><span>     </span><span id="local-6989586621681048125"><span id="local-6989586621681048126"><span class="annot"><a href="#local-6989586621681048130"><span class="hs-identifier hs-type">txnode</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681048126"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681048125"><span class="hs-identifier hs-type">x</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681048126"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681048125"><span class="hs-identifier hs-type">x</span></a></span></span></span><span>
</span><span id="line-402"></span><span>     </span><span id="local-6989586621681048130"><span class="annot"><span class="annottext">txnode :: forall (e :: Extensibility) (x :: Extensibility).
CmmNode e x -&gt; CmmNode e x
</span><a href="#local-6989586621681048130"><span class="hs-identifier hs-var hs-var">txnode</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmBranch"><span class="hs-identifier hs-type">CmmBranch</span></a></span><span> </span><span id="local-6989586621681048122"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048122"><span class="hs-identifier hs-var">bid</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Label -&gt; CmmNode O C
</span><a href="GHC.Cmm.Node.html#CmmBranch"><span class="hs-identifier hs-var">CmmBranch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Label -&gt; Label
</span><a href="#local-6989586621681048128"><span class="hs-identifier hs-var">lookup</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048122"><span class="hs-identifier hs-var">bid</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-403"></span><span>     </span><span class="annot"><a href="#local-6989586621681048130"><span class="hs-identifier hs-var">txnode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmCondBranch"><span class="hs-identifier hs-type">CmmCondBranch</span></a></span><span> </span><span id="local-6989586621681048119"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681048119"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621681048118"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048118"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621681048117"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048117"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621681048116"><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681048116"><span class="hs-identifier hs-var">l</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-404"></span><span>       </span><span class="annot"><span class="annottext">CmmExpr -&gt; Label -&gt; Label -&gt; Maybe Bool -&gt; CmmNode O C
</span><a href="GHC.Cmm.ContFlowOpt.html#mkCmmCondBranch"><span class="hs-identifier hs-var">mkCmmCondBranch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmExpr
</span><a href="#local-6989586621681048114"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681048119"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Label -&gt; Label
</span><a href="#local-6989586621681048128"><span class="hs-identifier hs-var">lookup</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048118"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Label -&gt; Label
</span><a href="#local-6989586621681048128"><span class="hs-identifier hs-var">lookup</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048117"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681048116"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-405"></span><span>     </span><span class="annot"><a href="#local-6989586621681048130"><span class="hs-identifier hs-var">txnode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmSwitch"><span class="hs-identifier hs-type">CmmSwitch</span></a></span><span> </span><span id="local-6989586621681048111"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681048111"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span id="local-6989586621681048110"><span class="annot"><span class="annottext">SwitchTargets
</span><a href="#local-6989586621681048110"><span class="hs-identifier hs-var">ids</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-406"></span><span>       </span><span class="annot"><span class="annottext">CmmExpr -&gt; SwitchTargets -&gt; CmmNode O C
</span><a href="GHC.Cmm.Node.html#CmmSwitch"><span class="hs-identifier hs-var">CmmSwitch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmExpr
</span><a href="#local-6989586621681048114"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681048111"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Label -&gt; Label) -&gt; SwitchTargets -&gt; SwitchTargets
</span><a href="GHC.Cmm.Switch.html#mapSwitchTargets"><span class="hs-identifier hs-var">mapSwitchTargets</span></a></span><span> </span><span class="annot"><span class="annottext">Label -&gt; Label
</span><a href="#local-6989586621681048128"><span class="hs-identifier hs-var">lookup</span></a></span><span> </span><span class="annot"><span class="annottext">SwitchTargets
</span><a href="#local-6989586621681048110"><span class="hs-identifier hs-var">ids</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-407"></span><span>     </span><span class="annot"><a href="#local-6989586621681048130"><span class="hs-identifier hs-var">txnode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmCall"><span class="hs-identifier hs-type">CmmCall</span></a></span><span> </span><span id="local-6989586621681048105"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681048105"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621681048104"><span class="annot"><span class="annottext">Maybe Label
</span><a href="#local-6989586621681048104"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621681048103"><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681048103"><span class="hs-identifier hs-var">rg</span></a></span></span><span> </span><span id="local-6989586621681048102"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681048102"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621681048101"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681048101"><span class="hs-identifier hs-var">res</span></a></span></span><span> </span><span id="local-6989586621681048100"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681048100"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-408"></span><span>       </span><span class="annot"><span class="annottext">CmmExpr
-&gt; Maybe Label -&gt; [GlobalReg] -&gt; Int -&gt; Int -&gt; Int -&gt; CmmNode O C
</span><a href="GHC.Cmm.Node.html#CmmCall"><span class="hs-identifier hs-var">CmmCall</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmExpr
</span><a href="#local-6989586621681048114"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681048105"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Label -&gt; Label) -&gt; Maybe Label -&gt; Maybe Label
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-identifier hs-var">liftM</span></a></span><span> </span><span class="annot"><span class="annottext">Label -&gt; Label
</span><a href="#local-6989586621681048128"><span class="hs-identifier hs-var">lookup</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Label
</span><a href="#local-6989586621681048104"><span class="hs-identifier hs-var">k</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681048103"><span class="hs-identifier hs-var">rg</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681048102"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681048101"><span class="hs-identifier hs-var">res</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681048100"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-409"></span><span>     </span><span class="annot"><a href="#local-6989586621681048130"><span class="hs-identifier hs-var">txnode</span></a></span><span> </span><span id="local-6989586621681048098"><span class="annot"><span class="annottext">fc :: CmmNode e x
</span><a href="#local-6989586621681048098"><span class="hs-identifier hs-var">fc</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><a href="GHC.Cmm.Node.html#CmmForeignCall"><span class="hs-identifier hs-type">CmmForeignCall</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-410"></span><span>       </span><span class="annot"><span class="annottext">CmmNode e x
</span><a href="#local-6989586621681048098"><span class="hs-identifier hs-var">fc</span></a></span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">args :: [CmmExpr]
</span><a href="GHC.Cmm.Node.html#args"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CmmExpr -&gt; CmmExpr) -&gt; [CmmExpr] -&gt; [CmmExpr]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmExpr
</span><a href="#local-6989586621681048114"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmNode O C -&gt; [CmmExpr]
</span><a href="GHC.Cmm.Node.html#args"><span class="hs-identifier hs-var hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode e x
CmmNode O C
</span><a href="#local-6989586621681048098"><span class="hs-identifier hs-var">fc</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">succ :: Label
</span><a href="GHC.Cmm.Node.html#succ"><span class="hs-identifier hs-var">succ</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Label -&gt; Label
</span><a href="#local-6989586621681048128"><span class="hs-identifier hs-var">lookup</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmNode O C -&gt; Label
</span><a href="GHC.Cmm.Node.html#succ"><span class="hs-identifier hs-var hs-var">succ</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode e x
CmmNode O C
</span><a href="#local-6989586621681048098"><span class="hs-identifier hs-var">fc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-411"></span><span>     </span><span class="annot"><a href="#local-6989586621681048130"><span class="hs-identifier hs-var">txnode</span></a></span><span> </span><span id="local-6989586621681048094"><span class="annot"><span class="annottext">CmmNode e x
</span><a href="#local-6989586621681048094"><span class="hs-identifier hs-var">other</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CmmExpr -&gt; CmmExpr) -&gt; CmmNode e x -&gt; CmmNode e x
forall (e :: Extensibility) (x :: Extensibility).
(CmmExpr -&gt; CmmExpr) -&gt; CmmNode e x -&gt; CmmNode e x
</span><a href="GHC.Cmm.Node.html#mapExpDeep"><span class="hs-identifier hs-var">mapExpDeep</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmExpr
</span><a href="#local-6989586621681048114"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="annot"><span class="annottext">CmmNode e x
</span><a href="#local-6989586621681048094"><span class="hs-identifier hs-var">other</span></a></span><span>
</span><span id="line-412"></span><span>
</span><span id="line-413"></span><span>     </span><span class="annot"><a href="#local-6989586621681048114"><span class="hs-identifier hs-type">exp</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span>
</span><span id="line-414"></span><span>     </span><span id="local-6989586621681048114"><span class="annot"><span class="annottext">exp :: CmmExpr -&gt; CmmExpr
</span><a href="#local-6989586621681048114"><span class="hs-identifier hs-var hs-var">exp</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span> </span><span id="local-6989586621681048090"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048090"><span class="hs-identifier hs-var">bid</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-var">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Label -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmBlock"><span class="hs-identifier hs-var">CmmBlock</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Label -&gt; Label
</span><a href="#local-6989586621681048128"><span class="hs-identifier hs-var">lookup</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048090"><span class="hs-identifier hs-var">bid</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-415"></span><span>     </span><span class="annot"><a href="#local-6989586621681048114"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmStackSlot"><span class="hs-identifier hs-type">CmmStackSlot</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.Expr.html#Young"><span class="hs-identifier hs-type">Young</span></a></span><span> </span><span id="local-6989586621681048087"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048087"><span class="hs-identifier hs-var">id</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681048086"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681048086"><span class="hs-identifier hs-var">i</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Area -&gt; Int -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmStackSlot"><span class="hs-identifier hs-var">CmmStackSlot</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Label -&gt; Area
</span><a href="GHC.Cmm.Expr.html#Young"><span class="hs-identifier hs-var">Young</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Label -&gt; Label
</span><a href="#local-6989586621681048128"><span class="hs-identifier hs-var">lookup</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048087"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681048086"><span class="hs-identifier hs-var">i</span></a></span><span>
</span><span id="line-416"></span><span>     </span><span class="annot"><a href="#local-6989586621681048114"><span class="hs-identifier hs-var">exp</span></a></span><span> </span><span id="local-6989586621681048085"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681048085"><span class="hs-identifier hs-var">e</span></a></span></span><span>                                      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681048085"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-417"></span><span>
</span><span id="line-418"></span><span class="annot"><a href="GHC.Cmm.ContFlowOpt.html#mkCmmCondBranch"><span class="hs-identifier hs-type">mkCmmCondBranch</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Node.html#CmmNode"><span class="hs-identifier hs-type">CmmNode</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#O"><span class="hs-identifier hs-type">O</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Block.html#C"><span class="hs-identifier hs-type">C</span></a></span><span>
</span><span id="line-419"></span><span id="mkCmmCondBranch"><span class="annot"><span class="annottext">mkCmmCondBranch :: CmmExpr -&gt; Label -&gt; Label -&gt; Maybe Bool -&gt; CmmNode O C
</span><a href="GHC.Cmm.ContFlowOpt.html#mkCmmCondBranch"><span class="hs-identifier hs-var hs-var">mkCmmCondBranch</span></a></span></span><span> </span><span id="local-6989586621681048084"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681048084"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621681048083"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048083"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621681048082"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048082"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621681048081"><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681048081"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-420"></span><span>  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048083"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Label -&gt; Label -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048082"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Label -&gt; CmmNode O C
</span><a href="GHC.Cmm.Node.html#CmmBranch"><span class="hs-identifier hs-var">CmmBranch</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048083"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; Label -&gt; Label -&gt; Maybe Bool -&gt; CmmNode O C
</span><a href="GHC.Cmm.Node.html#CmmCondBranch"><span class="hs-identifier hs-var">CmmCondBranch</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681048084"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048083"><span class="hs-identifier hs-var">t</span></a></span><span> </span><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048082"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Bool
</span><a href="#local-6989586621681048081"><span class="hs-identifier hs-var">l</span></a></span><span>
</span><span id="line-421"></span><span>
</span><span id="line-422"></span><span class="hs-comment">-- Build a map from a block to its set of predecessors.</span><span>
</span><span id="line-423"></span><span class="annot"><a href="GHC.Cmm.ContFlowOpt.html#predMap"><span class="hs-identifier hs-type">predMap</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-424"></span><span id="predMap"><span class="annot"><span class="annottext">predMap :: [CmmBlock] -&gt; LabelMap Int
</span><a href="GHC.Cmm.ContFlowOpt.html#predMap"><span class="hs-identifier hs-var hs-var">predMap</span></a></span></span><span> </span><span id="local-6989586621681048080"><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681048080"><span class="hs-identifier hs-var">blocks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CmmBlock -&gt; LabelMap Int -&gt; LabelMap Int)
-&gt; LabelMap Int -&gt; [CmmBlock] -&gt; LabelMap Int
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock -&gt; LabelMap Int -&gt; LabelMap Int
forall {map :: * -&gt; *} {a}
       {thing :: Extensibility -&gt; Extensibility -&gt; *}
       {e :: Extensibility}.
(IsMap map, Num a, NonLocal thing, KeyOf map ~ Label) =&gt;
thing e C -&gt; map a -&gt; map a
</span><a href="#local-6989586621681048079"><span class="hs-identifier hs-var">add_preds</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap Int
forall (map :: * -&gt; *) a. IsMap map =&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapEmpty"><span class="hs-identifier hs-var">mapEmpty</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681048080"><span class="hs-identifier hs-var">blocks</span></a></span><span>
</span><span id="line-425"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-426"></span><span>    </span><span id="local-6989586621681048079"><span class="annot"><span class="annottext">add_preds :: thing e C -&gt; map a -&gt; map a
</span><a href="#local-6989586621681048079"><span class="hs-identifier hs-var hs-var">add_preds</span></a></span></span><span> </span><span id="local-6989586621681048067"><span class="annot"><span class="annottext">thing e C
</span><a href="#local-6989586621681048067"><span class="hs-identifier hs-var">block</span></a></span></span><span> </span><span id="local-6989586621681048066"><span class="annot"><span class="annottext">map a
</span><a href="#local-6989586621681048066"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Label -&gt; map a -&gt; map a) -&gt; map a -&gt; [Label] -&gt; map a
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="annot"><span class="annottext">Label -&gt; map a -&gt; map a
forall {map :: * -&gt; *} {a}.
(IsMap map, Num a) =&gt;
KeyOf map -&gt; map a -&gt; map a
</span><a href="#local-6989586621681048065"><span class="hs-identifier hs-var">add</span></a></span><span> </span><span class="annot"><span class="annottext">map a
</span><a href="#local-6989586621681048066"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">thing e C -&gt; [Label]
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (e :: Extensibility).
NonLocal thing =&gt;
thing e C -&gt; [Label]
</span><a href="GHC.Cmm.Dataflow.Graph.html#successors"><span class="hs-identifier hs-var">successors</span></a></span><span> </span><span class="annot"><span class="annottext">thing e C
</span><a href="#local-6989586621681048067"><span class="hs-identifier hs-var">block</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-427"></span><span>      </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681048065"><span class="annot"><span class="annottext">add :: KeyOf map -&gt; map a -&gt; map a
</span><a href="#local-6989586621681048065"><span class="hs-identifier hs-var hs-var">add</span></a></span></span><span> </span><span id="local-6989586621681048059"><span class="annot"><span class="annottext">KeyOf map
</span><a href="#local-6989586621681048059"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621681048058"><span class="annot"><span class="annottext">map a
</span><a href="#local-6989586621681048058"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(a -&gt; a -&gt; a) -&gt; KeyOf map -&gt; a -&gt; map a -&gt; map a
forall (map :: * -&gt; *) a.
IsMap map =&gt;
(a -&gt; a -&gt; a) -&gt; KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsertWith"><span class="hs-identifier hs-var">mapInsertWith</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">(+)</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf map
</span><a href="#local-6989586621681048059"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">map a
</span><a href="#local-6989586621681048058"><span class="hs-identifier hs-var">env</span></a></span><span>
</span><span id="line-428"></span><span>
</span><span id="line-429"></span><span class="hs-comment">-- Removing unreachable blocks</span><span>
</span><span id="line-430"></span><span class="annot"><a href="GHC.Cmm.ContFlowOpt.html#removeUnreachableBlocksProc"><span class="hs-identifier hs-type">removeUnreachableBlocksProc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmDecl"><span class="hs-identifier hs-type">CmmDecl</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmDecl"><span class="hs-identifier hs-type">CmmDecl</span></a></span><span>
</span><span id="line-431"></span><span id="removeUnreachableBlocksProc"><span class="annot"><span class="annottext">removeUnreachableBlocksProc :: CmmDecl -&gt; CmmDecl
</span><a href="GHC.Cmm.ContFlowOpt.html#removeUnreachableBlocksProc"><span class="hs-identifier hs-var hs-var">removeUnreachableBlocksProc</span></a></span></span><span> </span><span id="local-6989586621681048057"><span class="annot"><span class="annottext">proc :: CmmDecl
</span><a href="#local-6989586621681048057"><span class="hs-identifier hs-var">proc</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-type">CmmProc</span></a></span><span> </span><span id="local-6989586621681048056"><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681048056"><span class="hs-identifier hs-var">info</span></a></span></span><span> </span><span id="local-6989586621681048055"><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681048055"><span class="hs-identifier hs-var">lbl</span></a></span></span><span> </span><span id="local-6989586621681048054"><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681048054"><span class="hs-identifier hs-var">live</span></a></span></span><span> </span><span id="local-6989586621681048053"><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681048053"><span class="hs-identifier hs-var">g</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-432"></span><span>   </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681048052"><span class="hs-identifier hs-var">used_blocks</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock] -&gt; Int -&gt; Bool
forall a. [a] -&gt; Int -&gt; Bool
</span><a href="GHC.Utils.Misc.html#lengthLessThan"><span class="hs-operator hs-var">`lengthLessThan`</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmBlock -&gt; Int
forall (map :: * -&gt; *) a. IsMap map =&gt; map a -&gt; Int
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapSize"><span class="hs-identifier hs-var">mapSize</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmGraph -&gt; LabelMap CmmBlock
</span><a href="GHC.Cmm.Utils.html#toBlockMap"><span class="hs-identifier hs-var">toBlockMap</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681048053"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-433"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmTopInfo -&gt; CLabel -&gt; [GlobalReg] -&gt; CmmGraph -&gt; CmmDecl
forall d h g. h -&gt; CLabel -&gt; [GlobalReg] -&gt; g -&gt; GenCmmDecl d h g
</span><a href="GHC.Cmm.html#CmmProc"><span class="hs-identifier hs-var">CmmProc</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681048048"><span class="hs-identifier hs-var">info'</span></a></span><span> </span><span class="annot"><span class="annottext">CLabel
</span><a href="#local-6989586621681048055"><span class="hs-identifier hs-var">lbl</span></a></span><span> </span><span class="annot"><span class="annottext">[GlobalReg]
</span><a href="#local-6989586621681048054"><span class="hs-identifier hs-var">live</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681048047"><span class="hs-identifier hs-var">g'</span></a></span><span>
</span><span id="line-434"></span><span>   </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-435"></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmDecl
</span><a href="#local-6989586621681048057"><span class="hs-identifier hs-var">proc</span></a></span><span>
</span><span id="line-436"></span><span>   </span><span class="hs-keyword">where</span><span>
</span><span id="line-437"></span><span>     </span><span id="local-6989586621681048047"><span class="annot"><span class="annottext">g' :: CmmGraph
</span><a href="#local-6989586621681048047"><span class="hs-identifier hs-var hs-var">g'</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Label -&gt; [CmmBlock] -&gt; CmmGraph
</span><a href="GHC.Cmm.Utils.html#ofBlockList"><span class="hs-identifier hs-var">ofBlockList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmGraph -&gt; Label
forall (n :: Extensibility -&gt; Extensibility -&gt; *).
GenCmmGraph n -&gt; Label
</span><a href="GHC.Cmm.html#g_entry"><span class="hs-identifier hs-var hs-var">g_entry</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681048053"><span class="hs-identifier hs-var">g</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681048052"><span class="hs-identifier hs-var">used_blocks</span></a></span><span>
</span><span id="line-438"></span><span>     </span><span id="local-6989586621681048048"><span class="annot"><span class="annottext">info' :: CmmTopInfo
</span><a href="#local-6989586621681048048"><span class="hs-identifier hs-var hs-var">info'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681048056"><span class="hs-identifier hs-var">info</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">info_tbls :: LabelMap CmmInfoTable
</span><a href="GHC.Cmm.html#info_tbls"><span class="hs-identifier hs-var">info_tbls</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LabelMap CmmInfoTable -&gt; LabelMap CmmInfoTable
</span><a href="#local-6989586621681048045"><span class="hs-identifier hs-var">keep_used</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmTopInfo -&gt; LabelMap CmmInfoTable
</span><a href="GHC.Cmm.html#info_tbls"><span class="hs-identifier hs-var hs-var">info_tbls</span></a></span><span> </span><span class="annot"><span class="annottext">CmmTopInfo
</span><a href="#local-6989586621681048056"><span class="hs-identifier hs-var">info</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-439"></span><span>             </span><span class="hs-comment">-- Remove any info_tbls for unreachable</span><span>
</span><span id="line-440"></span><span>
</span><span id="line-441"></span><span>     </span><span class="annot"><a href="#local-6989586621681048045"><span class="hs-identifier hs-type">keep_used</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmInfoTable"><span class="hs-identifier hs-type">CmmInfoTable</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmInfoTable"><span class="hs-identifier hs-type">CmmInfoTable</span></a></span><span>
</span><span id="line-442"></span><span>     </span><span id="local-6989586621681048045"><span class="annot"><span class="annottext">keep_used :: LabelMap CmmInfoTable -&gt; LabelMap CmmInfoTable
</span><a href="#local-6989586621681048045"><span class="hs-identifier hs-var hs-var">keep_used</span></a></span></span><span> </span><span id="local-6989586621681048044"><span class="annot"><span class="annottext">LabelMap CmmInfoTable
</span><a href="#local-6989586621681048044"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(LabelMap CmmInfoTable
 -&gt; KeyOf LabelMap -&gt; CmmInfoTable -&gt; LabelMap CmmInfoTable)
-&gt; LabelMap CmmInfoTable
-&gt; LabelMap CmmInfoTable
-&gt; LabelMap CmmInfoTable
forall (map :: * -&gt; *) b a.
IsMap map =&gt;
(b -&gt; KeyOf map -&gt; a -&gt; b) -&gt; b -&gt; map a -&gt; b
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapFoldlWithKey"><span class="hs-identifier hs-var">mapFoldlWithKey</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmInfoTable
-&gt; KeyOf LabelMap -&gt; CmmInfoTable -&gt; LabelMap CmmInfoTable
LabelMap CmmInfoTable
-&gt; Label -&gt; CmmInfoTable -&gt; LabelMap CmmInfoTable
</span><a href="#local-6989586621681048042"><span class="hs-identifier hs-var">keep</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmInfoTable
forall (map :: * -&gt; *) a. IsMap map =&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapEmpty"><span class="hs-identifier hs-var">mapEmpty</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmInfoTable
</span><a href="#local-6989586621681048044"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-443"></span><span>
</span><span id="line-444"></span><span>     </span><span class="annot"><a href="#local-6989586621681048042"><span class="hs-identifier hs-type">keep</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmInfoTable"><span class="hs-identifier hs-type">CmmInfoTable</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#Label"><span class="hs-identifier hs-type">Label</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmInfoTable"><span class="hs-identifier hs-type">CmmInfoTable</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelMap"><span class="hs-identifier hs-type">LabelMap</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.html#CmmInfoTable"><span class="hs-identifier hs-type">CmmInfoTable</span></a></span><span>
</span><span id="line-445"></span><span>     </span><span id="local-6989586621681048042"><span class="annot"><span class="annottext">keep :: LabelMap CmmInfoTable
-&gt; Label -&gt; CmmInfoTable -&gt; LabelMap CmmInfoTable
</span><a href="#local-6989586621681048042"><span class="hs-identifier hs-var hs-var">keep</span></a></span></span><span> </span><span id="local-6989586621681048041"><span class="annot"><span class="annottext">LabelMap CmmInfoTable
</span><a href="#local-6989586621681048041"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681048040"><span class="annot"><span class="annottext">Label
</span><a href="#local-6989586621681048040"><span class="hs-identifier hs-var">l</span></a></span></span><span> </span><span id="local-6989586621681048039"><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681048039"><span class="hs-identifier hs-var">i</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">ElemOf LabelSet
Label
</span><a href="#local-6989586621681048040"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">ElemOf LabelSet -&gt; LabelSet -&gt; Bool
forall set. IsSet set =&gt; ElemOf set -&gt; set -&gt; Bool
</span><a href="GHC.Cmm.Dataflow.Collections.html#setMember"><span class="hs-operator hs-var">`setMember`</span></a></span><span> </span><span class="annot"><span class="annottext">LabelSet
</span><a href="#local-6989586621681048037"><span class="hs-identifier hs-var">used_lbls</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
-&gt; CmmInfoTable -&gt; LabelMap CmmInfoTable -&gt; LabelMap CmmInfoTable
forall (map :: * -&gt; *) a.
IsMap map =&gt;
KeyOf map -&gt; a -&gt; map a -&gt; map a
</span><a href="GHC.Cmm.Dataflow.Collections.html#mapInsert"><span class="hs-identifier hs-var">mapInsert</span></a></span><span> </span><span class="annot"><span class="annottext">KeyOf LabelMap
Label
</span><a href="#local-6989586621681048040"><span class="hs-identifier hs-var">l</span></a></span><span> </span><span class="annot"><span class="annottext">CmmInfoTable
</span><a href="#local-6989586621681048039"><span class="hs-identifier hs-var">i</span></a></span><span> </span><span class="annot"><span class="annottext">LabelMap CmmInfoTable
</span><a href="#local-6989586621681048041"><span class="hs-identifier hs-var">env</span></a></span><span>
</span><span id="line-446"></span><span>                  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LabelMap CmmInfoTable
</span><a href="#local-6989586621681048041"><span class="hs-identifier hs-var">env</span></a></span><span>
</span><span id="line-447"></span><span>
</span><span id="line-448"></span><span>     </span><span class="annot"><a href="#local-6989586621681048052"><span class="hs-identifier hs-type">used_blocks</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.html#CmmBlock"><span class="hs-identifier hs-type">CmmBlock</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-449"></span><span>     </span><span id="local-6989586621681048052"><span class="annot"><span class="annottext">used_blocks :: [CmmBlock]
</span><a href="#local-6989586621681048052"><span class="hs-identifier hs-var hs-var">used_blocks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmGraph -&gt; [CmmBlock]
</span><a href="GHC.Cmm.Utils.html#revPostorder"><span class="hs-identifier hs-var">revPostorder</span></a></span><span> </span><span class="annot"><span class="annottext">CmmGraph
</span><a href="#local-6989586621681048053"><span class="hs-identifier hs-var">g</span></a></span><span>
</span><span id="line-450"></span><span>
</span><span id="line-451"></span><span>     </span><span class="annot"><a href="#local-6989586621681048037"><span class="hs-identifier hs-type">used_lbls</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Dataflow.Label.html#LabelSet"><span class="hs-identifier hs-type">LabelSet</span></a></span><span>
</span><span id="line-452"></span><span>     </span><span id="local-6989586621681048037"><span class="annot"><span class="annottext">used_lbls :: LabelSet
</span><a href="#local-6989586621681048037"><span class="hs-identifier hs-var hs-var">used_lbls</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ElemOf LabelSet] -&gt; LabelSet
forall set. IsSet set =&gt; [ElemOf set] -&gt; set
</span><a href="GHC.Cmm.Dataflow.Collections.html#setFromList"><span class="hs-identifier hs-var">setFromList</span></a></span><span> </span><span class="annot"><span class="annottext">([ElemOf LabelSet] -&gt; LabelSet) -&gt; [ElemOf LabelSet] -&gt; LabelSet
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmBlock -&gt; Label) -&gt; [CmmBlock] -&gt; [Label]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">CmmBlock -&gt; Label
forall (thing :: Extensibility -&gt; Extensibility -&gt; *)
       (x :: Extensibility).
NonLocal thing =&gt;
thing C x -&gt; Label
</span><a href="GHC.Cmm.Dataflow.Graph.html#entryLabel"><span class="hs-identifier hs-var">entryLabel</span></a></span><span> </span><span class="annot"><span class="annottext">[CmmBlock]
</span><a href="#local-6989586621681048052"><span class="hs-identifier hs-var">used_blocks</span></a></span><span>
</span><span id="line-453"></span></pre></body></html>